Created
December 25, 2011 15:25
-
-
Save hidenorigoto/1519406 to your computer and use it in GitHub Desktop.
nginx Symfony2 example (subdirectory) WIP
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; | |
root /var/www/sitename; | |
server_name sitename; | |
index index.html index.php app.php; | |
if ($uri ~ \.(css|png|js|gif|jpg)$) { | |
break; | |
} | |
if ($uri !~ \/(app|app_dev)\.php) { | |
rewrite ^\/symfony-standard\/web\/(.*)$ /symfony-standard/web/app.php/$1 last; | |
} | |
location /symfony-standard/web/ { | |
if (-f $request_filename) { | |
break; | |
} | |
} | |
location ~ \.php(\/|$) { | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment