server { listen 80; server_name www.xxx.com; index index.html index.htm index.php; root /home/wwwroot/default/目录; location ~ \.php{ fastcgi_index index.php; fastcgi_pass 127.0.0.1:9000; fastcgi_intercept_errors on; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_split_path_info ^(.+\.php)(.*)$; #添加 fastcgi_param PATH_INFO $fastcgi_path_info; #添加 } location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; } } if (!-e $request_filename) { rewrite ^(/index\.php)?/(.*)$ /index.php/$2 break; } access_log /home/wwwlogs/access.log; }
server { listen 80; server_name friend.crm.com; root "E:/wamp/lefujin_friends_crm/public"; location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; } } location ~* ^(.*)/[^/]+\.php$ { root E:/wamp/lefujin_friends_crm/public; include fastcgi_params; include fastcgi.conf; fastcgi_split_path_info ^(.+\.php)(/.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; set $scripts "$1/WEB-INF/entry.php"; if (-f $request_filename) { set $scripts $fastcgi_script_name; break; } fastcgi_param SCRIPT_FILENAME $document_root$scripts; fastcgi_pass 127.0.0.1:9000; #log_not_found off; } }
server { listen 87; server_name localhost; charset utf-8; #access_log /var/log/nginx/access.log main; #error_log /var/log/nginx/error.log warn; root /Users/mac059/project/backend-Service/public; gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_http_version 1.0; gzip_comp_level 6; gzip_types text/plain application/javascript application/x-javascript text/xml text/css; gzip_disable "MSIE [1-6]\."; gzip_vary on; location / { try_files $uri $uri/ /index.php?$query_string; index index.php index.html index.htm; } location ~ \.php$ { try_files $uri /index.php =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; #fastcgi_pass unix:/run/php/php-fpm.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param HTTP_X_FORWARDED_FOR ''; fastcgi_param HTTP_X_REAL_IP ''; fastcgi_param HTTP_CLIENT_IP ''; fastcgi_param HTTP_PROXY ''; include fastcgi_params; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css|csv)$ { root /Users/mac059/project/backend-Service/public; expires 30d; } }