>  기사  >  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/  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 ;<br>             set $path_info ;<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으로 문의하세요.