正在为你努力加载中........

点滴记录 分享
30
2014-10
首页 >> 个人项目 >> 个人项目nginx的配置

个人项目nginx的配置

server {
        listen       80;
        server_name  v.cicms.dev;
        charset utf-8;
		access_log  /web/cicms/cicms.access.log  main; #访问日志
        location / {
            root   /web/cicms;
            index  index.php index.html index.htm;
			rewrite ^/$/index.php last;
			rewrite ^/(?!index\.php|robots\.txt|data|admin_application)(.*)$ /index.php/$1 last;
        }
        error_page  404              /404.html;
        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /web/cicms;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
         location ~^(.+\.php)(.*)$ {
            root           /web/cicms;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
			fastcgi_split_path_info ^(.+\.php)(.*)$;
			fastcgi_param   SCRIPT_FILENAME   $document_root$fastcgi_script_name;
			#fastcgi_split_path_info ^(.+\.php)(.*)$;
			fastcgi_param   PATH_INFO      $fastcgi_path_info;
			fastcgi_param   PATH_TRANSLATED   $document_root$fastcgi_path_info;
			include   fastcgi_params;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }

作者:一根烟的寂寞 分类:个人项目
浏览:1594 评论:0

发表评论: