Created
February 18, 2014 08:05
-
-
Save linjunpop/9066568 to your computer and use it in GitHub Desktop.
Rails Nginx configuration
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 QAirServer_server{ | |
server unix:/opt/QAirServer/shared/sockets/puma.sock fail_timeout=0; | |
} | |
server { | |
listen 443 default deferred ssl; | |
server_name qairapp.com; | |
root /opt/QAirServer/current/public; | |
ssl on; | |
ssl_certificate /opt/QAirServer/shared/server.crt; | |
ssl_certificate_key /opt/QAirServer/shared/server.key; | |
ssl_session_timeout 5m; | |
ssl_protocols SSLv2 SSLv3 TLSv1; | |
ssl_ciphers HIGH:!aNULL:!MD5; | |
ssl_prefer_server_ciphers on; | |
location / { | |
proxy_set_header X-Real-IP $remote_addr; | |
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; | |
if (-f $request_filename) { | |
expires max; | |
break; | |
} | |
if (!-f $request_filename) { | |
proxy_pass http://QAirServer_server; | |
break; | |
} | |
} | |
error_page 500 502 503 504 /500.html; | |
location = /500.html { | |
root /opt/QAirServer/current/public; | |
} | |
client_max_body_size 14M; | |
client_body_buffer_size 128k; | |
keepalive_timeout 10; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment