tp5-nginx配置 发表于 2019-06-04 | 更新于 2020-03-02 | 分类于 运维做项目要弄一个微信管理系统,涉及到tp5,为了pathinfo问题改了好久的配置。耽误了不少的功夫。当然其中也有项目的因素,更加坚定了之前的想法。废话不说,适应tp的配置如下:1234567891011121314151617181920212223242526server { listen 80; root /www/rhaphp; index index.php index.html index.htm index.nginx-debian.html; server_name rhaphp.localhost; location / { index index.php index.html index.htm; try_files $uri /index.php$uri; if (!-e $request_filename) { #rewrite ^/(.*)$ /index.php?$1 last; rewrite ^(.*)$ /index.php?s=$1 last; break; } client_max_body_size 50m; } location ~ \.php(.*)$ { fastcgi_pass php:9000; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; include fastcgi_params; }}