環境:centos(7.3) nginx(1.12) php-fpm(7.1.9)php
nginx服務器:192.168.1.72css
安裝nginx服務器,而且部署靜態內容。html
配置nginx.conf文件修改nginx
server { listen 80; server_name localhost; try_files $uri $uri/ /index.php?$query_string; location ~* \.(css|js)$ { root /var/html/static } location ~* \.(png|ico|gif|jpg|jpeg)$ { root /var/html/image } location / { fastcgi_pass 192.168.1.172:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/html/yd_laravel/public$fastcgi_script_name; include /usr/local/nginx/conf/fastcgi_params; } }
php-fpm服務器:192.168.1.172laravel
安裝php服務和php-fpm,部署php代碼centos
編輯php-fpm.conf配置文件服務器
listen = 127.0.0.1:9000php-fpm
修改成:listen = 192.168.1.172:9000spa
重啓php-fpm服務code
完成。