Skip to content

Instantly share code, notes, and snippets.

@iMagesh
Created July 17, 2015 12:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iMagesh/ba6407d56644130f14f9 to your computer and use it in GitHub Desktop.
Save iMagesh/ba6407d56644130f14f9 to your computer and use it in GitHub Desktop.
nginx ssl config rails
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