Skip to content

Instantly share code, notes, and snippets.

@c80609a
Last active September 11, 2015 11:53
Show Gist options
  • Save c80609a/56521bd7b44d99b188e4 to your computer and use it in GitHub Desktop.
Save c80609a/56521bd7b44d99b188e4 to your computer and use it in GitHub Desktop.
site.conf
server {
listen 80;
server_name <...>.com;
passenger_enabled on;
passenger_start_timeout 180;
passenger_load_shell_envvars off;
root /home/webmaster/git/bitbucket/s40/public;
client_max_body_size 32m;
location / {
# Tells Nginx to forward all requests for www.foo.com
# to the Passenger Standalone instance listening on port 4040.
proxy_pass http://127.0.0.1:4040;
# These are "magic" Nginx configuration options that
# should be present in order to make the reverse proxying
# work properly. Also contains some options that make WebSockets
# work properly with Passenger Standalone. Please learn more at
# http://nginx.org/en/docs/http/ngx_http_proxy_module.html
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_buffering off;
}
# redirect server error pages to the static page /40x.html
#
error_page 404 /404.html;
location = /40x.html {
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
server {
server_name www.<...>.com;
rewrite ^(.*) http://<..>.com$1 permanent;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment