Skip to content

Instantly share code, notes, and snippets.

@viccherubini
Created November 4, 2013 03:24
Show Gist options
  • Save viccherubini/7297662 to your computer and use it in GitHub Desktop.
Save viccherubini/7297662 to your computer and use it in GitHub Desktop.
Expert PHP Deployments Nginx virtual host configuration file.
server {
listen 80;
server_name expertphpdeployments.com www.expertphpdeployments.com;
return 301 https://expertphpdeployments.com$request_uri;
}
server {
listen 443;
server_name expertphpdeployments.com;
root /srv/http/apps/expertphpdeployments.com/current/web;
ssl on;
ssl_certificate /srv/http/ssl/expertphpdeployments.com-intermediate.crt;
ssl_certificate_key /srv/http/ssl/expertphpdeployments.com.pem;
access_log /srv/http/apps/expertphpdeployments.com/shared/log/http-access.log;
error_log /srv/http/apps/expertphpdeployments.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;
}
location ~ ^index.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