首页  >  文章  >  php教程  >  thinkphp的nginx配置

thinkphp的nginx配置

WBOY
WBOY原创
2016-08-04 08:56:201199浏览

thinkphp的nginx配置
server {<br>     listen       80;<br>     server_name  www.abc.com;<br> <br>     #charset utf-8;<br> <br>     access_log  /var/www/www.abc.com/log/host.access.log;<br>     error_log   /var/www/www.abc.com/log/error.log;<br> <br>     # gzip off;<br> <br>     root        /var/www/www.abc.com/web;<br>     index       index.php index.html index.htm;<br> <br>     location / {<br>         if (!-e $request_filename) {<br>            rewrite  ^/(.*)$  /index.php/$1  last;<br>            break;<br>         }<br>     }<br> <br>     location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {<br>         expires 100d;<br>     }<br>     location ~ .*\.(js|css)?$ {<br>         expires 30d;<br>     }<br> <br>     #error_page  404              /404.html;<br> <br>     # redirect server error pages to the static page /50x.html<br>     #<br>     error_page   500 502 503 504  /50x.html;<br>     location = /50x.html {<br>         root   html;<br>     }<br> <br>     # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000<br>     #<br>     location ~ \.php(/|$) {<br>         fastcgi_pass   127.0.0.1:9000;<br>         fastcgi_index  index.php;<br>         include        fastcgi.conf;<br> <br>         set $fastcgi_script_name2 $fastcgi_script_name;<br>         if ($fastcgi_script_name ~ "^(.+\.php)(/.+)$") {<br>             set $fastcgi_script_name2 $1;<br>             set $path_info $2;<br>         }<br>         fastcgi_param   PATH_INFO $path_info;<br>         fastcgi_param   SCRIPT_FILENAME   $document_root$fastcgi_script_name2;<br>         fastcgi_param   SCRIPT_NAME   $fastcgi_script_name2;<br>     }<br> }

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn