- server {
- listen 80;
- server_name test.genplahotel.com;
- index index.html index.htm index.PHP;
- root /home/wwwroot/genplahotel/public;
- location / {
- try_files $uri $uri/ /index.PHP?$query_string;
- # try_files $uri $uri/index.PHP?$query_string;
- # if ( $http_user_agent !~* "(Android|iPhone|Windows Phone|UC|Kindle)" ){
- # rewrite ^/(.*)$ http://www.net-tactic.com$uri redirect;
- # }
- }
- location ~ .*\.(PHP|php5|php7)?$
- {
- #fastcgi_pass unix:/tmp/PHP-CGI.sock;
- fastcgi_pass 127.0.0.1:9001;
- fastcgi_index index.PHP;
- #include fastcgi.conf;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- #fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
- include fastcgi_params;
- #fastcgi_param PHP_VALUE "open_basedir=/home/wwwroot/genplahotel/:/tmp/:/proc/";
- }
- location ~ .*\.(gif|jpg|jpeg|PNG|bmp|swf)$
- {
- expires 30d;
- }
- location ~ .*\.(JS|CSS)?$
- {
- expires 1h;
- }
- #α¾²Ì¬¹æÔò
- # include /alidata/server/nginx/conf/rewrite/default.conf;
- access_log /home/wwwlogs/access.log;
- }
1,
注意点
来源: http://www.bubuko.com/infodetail-3496430.html