最近一直没用nginx
昨天将tp3.2的项目部署到Ubuntu下的nginx下,发现忘记怎么配置的了
特将配置方式记录下来,以方便日后查找
服务器nignx 配置文件 server { listen 8081; server_name XX.XX.XX.XX; root /www/ppm; index index.html index.htm index.php index.nginx-debian.html; location / { if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?$1 last; break; } try_files $uri $uri/ =404; } location ~ /.php(.*)$ { fastcgi_pass unix:/run/php/php7.0-fpm.sock; fastcgi_index index.php; fastcgi_split_path_info ^((?U).+/.php)(/?.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; include fastcgi_params; } }
重启nginx
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/20367.html