Created
November 10, 2017 13:07
-
-
Save robertwe/6b66559729a0e7450e7dd2d1fcd61025 to your computer and use it in GitHub Desktop.
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 { | |
server_name myhostname.local; | |
root /var/www/symfony/web; | |
location / { | |
try_files $uri @rewriteapp; | |
} | |
location @rewriteapp { | |
rewrite ^(.*)$ /app_dev.php/$1 last; | |
} | |
location ~ ^/(app|app_dev|config)\.php(/|$) { | |
fastcgi_pass php-upstream; | |
fastcgi_split_path_info ^(.+\.php)(/.*)$; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; | |
fastcgi_param DOCUMENT_ROOT $realpath_root; | |
} | |
# Statics | |
location ~ (bundles|css|fonts|images|js)(/.*)$ { | |
#Im desperated | |
if (!-f $uri){ | |
return 404; | |
} | |
# end of the act of desperation | |
access_log off; | |
expires 30d; | |
add_header 'Access-Control-Allow-Origin' '*'; | |
add_header 'Access-Control-Allow-Methods' 'GET'; | |
try_files $uri =404; | |
} | |
error_log /var/log/nginx/symfony_error.log debug; | |
access_log /var/log/nginx/symfony_access.log debug; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment