HOME 生活记录运维/编程
作者/来源:yixinu.com
栏目:运维/编程
日期:2014-09-29 17:32:45
 server {

        listen       8080;
        server_name  static.jeexue.cn;
        charset utf-8;
        #access_log  logs/host.access.log  main;
        set $path1  /data/www/jeexue.com/static; 
        location / {
            root   $path1;
            index  index.php index.html index.htm;
        }

        location /admin/ {
            root  $path1; 
            index  index.php index.htm;

            if (!-e $request_filename) {
                rewrite ^/admin/(.*)$  /admin/index.php?s=$1   last;
                break;
            }

        }

        error_page  404              /404.html;
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        location ~ \.php$ {
            root           $path1; 
            fastcgi_pass   j1;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
            fastcgi_intercept_errors on;
        }

        location ~ /\.ht {
            deny  all;
        }
    }
分享到:

Copyright © 2013-2014 yixinu.com 湘ICP备14004402号

QQ:316686606  Email: 316686606@qq.com