Nginx Symfony 2 Config
Important Remark: The following configuration makes all PHP scripts except app.php, app_dev.php and config.php downloadable instead of executing them. This is probably not desired if you'd like to use a tool like phpMyAdmin in the same virtual host.
server {
    # make sure you point it at the "web" subfolder
    root /PATH/TO/PROJECT/web; 
    server_name SERVER_NAME;
    index app.php;
    try_files $uri $uri/ /app.php?$query_string;
    location ~ ^/(app_dev|app|config.php)\.php(/|$) {
        include fastcgi_params;
        # you may change the following parameter
        fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}Written by 家儒
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
 #Nginx 
Authors
reiaguilera
280.6K
 
jamesdullaghan
90.77K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#
 
 
