码迷,mamicode.com
首页 > 其他好文 > 详细

nginx(五)我的系统的配置文件

时间:2015-04-13 16:53:27      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:

静态虚拟机的配置:

server {

         listen       80;

         server_name  s.juancdn.com;

         root /var/www/html/static/;

         index  index.html index.htm;


         location / { #这里是 concat模块的配置

                concat on;

                concat_max_files 30;

                concat_types text/css application/javascript;

                concat_unique off;

         }

    }

系统虚拟机的配置:

server {

        listen       80;

        server_name  *.juanpi.com;


        root /var/www/html/juanpi_v3/;

        index  index.php index.html index.htm;


        access_log  logs/juanpi.access.log  main;


        gzip on;

        gzip_min_length 1k;

        gzip_buffers 4 16k;

        gzip_http_version 1.1;

        gzip_comp_level 2;

        gzip_types text/plain application/x-javascript text/css application/xml;

        gzip_vary on;


        location / {

            if (!-e $request_filename) {

                rewrite ^(.*)$ /index.php/$1 last;

                break;

            }


            access_log   off;

        }

location ~ .+\.php($|/) {

            fastcgi_pass  127.0.0.1:9000;

            fastcgi_index  index.php?IF_REWRITE=1;

            include fastcgi_params;

            set $script $uri;

            set $path_info  "/";

            if ($uri ~ "^(.+\.php)(/.+)") {

                set $script     $1;

                set $path_info  $2;

            }

            fastcgi_param PATH_INFO $path_info;

            fastcgi_param SCRIPT_FILENAME  $document_root/$script;

            fastcgi_param SCRIPT_NAME $script;

            access_log off;

            add_header Content-Length "$content_length";

        }


    }


nginx(五)我的系统的配置文件

标签:

原文地址:http://my.oschina.net/u/1156660/blog/400528

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!