Skip to content

Instantly share code, notes, and snippets.

@maletor
Created April 12, 2010 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maletor/363446 to your computer and use it in GitHub Desktop.
Save maletor/363446 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name ellisberner.com;
access_log /var/log/nginx/localhost.access.log;
root /var/www/ellisberner.com/current/public;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://app_server;
break;
}
}
error_page 404 /404.html;
location = /404.html {
root /var/www/ellisberner.com/current/public;
}
error_page 422 /422.html;
location = /422.html {
root /var/www/ellisberner.com/current/public;
}
error_page 500 502 503 504 /500.html;
location = /500.html {
root /var/www/ellisberner.com/current/public;
}
}
# HTTPS Server
#
server {
listen 443;
server_name ellisberner.com;
ssl on;
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;
server_name localhost;
access_log /var/log/nginx/localhost.access.log;
root /var/www/ellisberner.com/current/public;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://app_server;
break;
}
}
error_page 404 /404.html;
location = /404.html {
root /var/www/ellisberner.com/current/public;
}
error_page 422 /422.html;
location = /422.html {
root /var/www/ellisberner.com/current/public;
}
error_page 500 502 503 504 /500.html;
location = /500.html {
root /var/www/ellisberner.com/current/public;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment