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

Nginx访问Symfony2项目配置

时间:2015-10-10 17:16:30      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:

server {
    listen       80;
    charset utf-8;
    autoindex on;
    server_name_in_redirect off;
    server_name  www.example.com;
    root D:/phpStudy/WWW/example/web;

    rewrite ^/app\.php/?(.*)$ /$1 permanent;

    location / {
        index app.php;
        try_files $uri @rewriteapp;
    }

    location @rewriteapp {
        rewrite ^(.*)$ /app.php/$1 last;
    }

    # redirect server error pages to the static page /50x.html
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }

    # 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 ~ ^/(app|app_dev)\.php(/|$) {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  app.php;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param HTTPS off;
        include D:/Wamp/nginx-1.9.5/conf/fastcgi_params;
    }

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

  

Nginx访问Symfony2项目配置

标签:

原文地址:http://www.cnblogs.com/atblog/p/4867429.html

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