Heim  >  Artikel  >  php教程  >  thinkphp nginx-Konfiguration

thinkphp nginx-Konfiguration

WBOY
WBOYOriginal
2016-08-04 08:56:201199Durchsuche

thinkphp nginx-Konfiguration
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> }

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn