Created
May 13, 2018 15:06
-
-
Save aaronmyatt/30f1e0166976a764acac259a8f80ccb7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
upstream {{APP_NAME}} { | |
server unix:/home/{{APP_NAME}}/app/shared/unicorn.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name example.com; | |
root /home/{{APP_NAME}}/app/current/public; | |
location /assets/ { | |
gzip_static on; # serve pre-gzipped version | |
expires 1M; | |
add_header Cache-Control public; | |
} | |
location / { | |
try_files $uri @app; | |
} | |
location @app { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://{{APP_NAME}}; | |
} | |
} | |
server { | |
listen 80; | |
server_name www.example.com; | |
return 301 http://example.com$request_uri; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment