Skip to content

Instantly share code, notes, and snippets.

@altexy
Last active November 2, 2018 11:16
Show Gist options
  • Save altexy/f94a809668aca284c6777e776ded412b to your computer and use it in GitHub Desktop.
Save altexy/f94a809668aca284c6777e776ded412b to your computer and use it in GitHub Desktop.
proxy with upstream connections keepalive
worker_processes auto;
worker_rlimit_nofile 65535;
error_log /certs/error.log debug;
events {
worker_connections 15000;
multi_accept on;
use epoll;
}
http {
resolver 8.8.8.8;
keepalive_requests 100000;
tcp_nopush on;
tcp_nodelay off;
upstream backend {
server 46.174.180.163;
keepalive 100;
}
server {
server_name bilet.intercity.pl;
listen 443 ssl reuseport backlog=10000 fastopen=256;
access_log /certs/access.log;
ssl_certificate /certs/nginx.crt;
ssl_certificate_key /certs//nginx.key;
add_header Strict-Transport-Security "max-age=31536000";
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA HIGH !RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS";
server_tokens off;
location / {
proxy_ssl_session_reuse on;
proxy_pass https://backend;
proxy_http_version 1.1;
proxy_redirect off;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Connection "";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment