Skip to content

Instantly share code, notes, and snippets.

@viccherubini
Last active December 26, 2015 20:28
Show Gist options
  • Save viccherubini/7208361 to your computer and use it in GitHub Desktop.
Save viccherubini/7208361 to your computer and use it in GitHub Desktop.
Advanced Web Applications Using Symfony Nginx virtual host configuration file.
server {
listen 80;
server_name majorauth.com www.majorauth.com;
return 301 https://majorauth.com$request_uri;
}
server {
listen 443;
server_name majorauth.com;
root /srv/http/apps/majorauth.com/current/web;
ssl on;
ssl_certificate /srv/http/ssl/majorauth.com-intermediate.crt;
ssl_certificate_key /srv/http/ssl/majorauth.com.pem;
access_log /srv/http/apps/majorauth.com/shared/log/http-access.log;
error_log /srv/http/apps/majorauth.com/shared/log/http-error.log crit;
add_header Strict-Transport-Security max-age=31536000;
add_header X-Frame-Options DENY;
location / {
try_files $uri @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}
location ~ ^/(app|app_dev|config)\.php(/|$) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment