示例:
server { listen 80; server_name dev.showapi.com; root /data/www/showdoc; location / { index index.php index.html index.htm; autoindex off; if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; } } location ~ \.php { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } access_log /data/web_log/dev.showapi.com_access.log; error_log /data/web_log/dev.showapi.com_error.log; }
文章处于要试用一套程序,一位大神开发的showdoc ,由于程序是采用tp开发,只能研究下nginx下对于tp的配置.