Created
September 14, 2015 21:32
-
-
Save rossta/f9ca70cd3db5616b6b94 to your computer and use it in GitHub Desktop.
This file contains 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 devpost { | |
server unix:/web/platform/tmp/sockets/unicorn.sock fail_timeout=0; | |
} | |
server { # main app | |
listen 80; | |
server_name .devpost.dev; | |
root /web/devpost/public; | |
location / { | |
# needed to forward user's IP address to rails | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header X-Queue-Start "t=${msec}"; | |
proxy_redirect off; | |
proxy_max_temp_file_size 0; | |
client_max_body_size 58M; | |
proxy_pass http://devpost; | |
} | |
location ~* \.(eot|ttf|woff|svg)$ { | |
add_header Access-Control-Allow-Origin *; | |
proxy_pass http://devpost; | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root html; | |
} | |
# redirect | |
# from: vrjam.challengepost.com/rules | |
# to: vrjam.challengepost.com/details/rules | |
# location /rules { | |
# if ($host ~* ^vrjam\.) { | |
# rewrite ^(.*)$ $scheme://$host/details/rules redirect; | |
# break; | |
# } | |
# } | |
} | |
server { | |
listen 443 ssl spdy; | |
server_name .devpost.dev; | |
# To enable ssl certificates uncomment this: | |
ssl on; | |
ssl_certificate platform.dev.crt; | |
ssl_certificate_key platform.dev.key; | |
ssl_session_timeout 5m; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_ciphers HIGH:!aNULL:!MD5; | |
ssl_prefer_server_ciphers on; | |
spdy_chunk_size 8k; | |
spdy_headers_comp 3; | |
root /web/platform/public; | |
include proxy_settings.conf; | |
if (-f $request_filename) { | |
break; | |
} | |
location / { | |
client_max_body_size 58M; | |
if (!-f $request_filename) { | |
proxy_pass http://devpost; | |
break; | |
} | |
} | |
location ~* \.(eot|ttf|woff|svg)$ { | |
add_header Access-Control-Allow-Origin *; | |
if (!-f $request_filename) { | |
proxy_pass http://devpost; | |
break; | |
} | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root html; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment