首页 > 其他 > 详细

lnmp集成环境tp nginx vhost配置

时间:2017-08-23 09:25:57      阅读:383      评论:0      收藏:0      [点我收藏+]
server {
                listen       80;
                server_name xxx;
                charset utf-8;
                root /home/wwwroot/axxx/public;
                index  index.html index.htm index.php;

                error_log logs/xxx.log;
                location / {
                        if (!-e $request_filename) {
                                rewrite ^(.*)$ /index.php?s=$1 last;
                                break;
                        }
                }
                error_page   500 502 503 504  /50x.html;
                location = /50x.html {
                        root   html;
                }

                location ~ [^/]\.php(/|$) {
                   fastcgi_pass   unix:/tmp/php-cgi.sock;
                   fastcgi_index index.php;
                   include fastcgi_params;
                   set $real_script_name $fastcgi_script_name;
                   if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
                           set $real_script_name $1;
                           set $path_info $2;
                   }
                   fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
                   fastcgi_param SCRIPT_NAME $real_script_name;
                   fastcgi_param PATH_INFO $path_info;
                }
                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
                        expires 30d;
                        access_log off;
                }
                location ~ .*\.(js|css)?$ {
                        expires 7d;
                        access_log off;
           }
}

  

 

lnmp集成环境tp nginx vhost配置

原文:http://www.cnblogs.com/eleven24/p/7416393.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!