Skip to content

Instantly share code, notes, and snippets.

@wellington1993
Created May 7, 2019 20:24
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 wellington1993/22fe970b5da65408d4cf5d2ed2bd40d4 to your computer and use it in GitHub Desktop.
Save wellington1993/22fe970b5da65408d4cf5d2ed2bd40d4 to your computer and use it in GitHub Desktop.
Nginx Conf Example
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name localhost;
ssl_certificate /etc/ssl/certs/localhost.crt;
ssl_certificate_key /etc/ssl/private/localhost.key;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
# Optimizations
ssl_session_cache shared:SSL:120m;
ssl_session_timeout 1d;
ssl_buffer_size 1k;
keepalive_timeout 300;
keepalive_requests 1024;
tcp_nodelay on;
tcp_nopush on;
sendfile on;
location / {
proxy_http_version 1.1;
proxy_pass http://unix:///tmp/server-puma;
proxy_redirect off;
proxy_set_header Connection "";
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_set_header Keep-Alive timeout=30,max=100;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment