Created
July 17, 2015 12:07
-
-
Save iMagesh/ba6407d56644130f14f9 to your computer and use it in GitHub Desktop.
nginx ssl config rails
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 myapp{ | |
# fail_timeout=0 means we always retry an upstream even if it failed | |
# to return a good HTTP response (in case the Unicorn master nukes a single worker for timing out). | |
server 127.0.0.1:3000; | |
} | |
server { | |
#listen 80 ssl; | |
listen 443 ssl; | |
server_name beta.app.co; | |
ssl_certificate /srv/ssl/beta_app_co.crt; | |
ssl_certificate_key /srv/ssl/beta_app_co.pem; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_ciphers HIGH:!aNULL:!MD5; | |
access_log /usr/local/nginx/logs/app-access.log; | |
error_log /usr/local/nginx/logs/app-error.log; | |
root /home/ubuntu/projects/app/public; | |
location / { | |
proxy_pass http://myapp; | |
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 https; | |
proxy_set_header Host $host; | |
proxy_redirect off; | |
} | |
location ^~ /assets/ { | |
#gzip_static on; | |
expires max; | |
add_header Cache-Control public; | |
} | |
#keepalive_timeout 10; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment