Last active
October 4, 2015 05:57
-
-
Save dizda/2589229 to your computer and use it in GitHub Desktop.
sample configuration file of nginx for symfony2 project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen [::]:80;# to listenning both on IPv4 & IPv6 | |
server_name dev.youserver.com; | |
location / { | |
root /opt/www/dev.yourserver.com/symfony/web; | |
index app.php; | |
if ($request_filename !~ "\.(htc|ico|gif|jpg|jpeg|png|css|js)$") { | |
rewrite ^(.*) /app.php$1 last; | |
} | |
} | |
location ~ \.php($|/) { | |
set $script $uri; | |
set $path_info ""; | |
if ($uri ~ "^(.+\.php)(/.+)") { | |
set $script $1; | |
set $path_info $2; | |
} | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
include fastcgi_params; | |
#fastcgi_buffers 8 16k; | |
#fastcgi_buffer_size 32k; | |
fastcgi_param SCRIPT_FILENAME /opt/www/dev.yourserver.com/symfony/web$script; | |
fastcgi_param PATH_INFO $path_info; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment