Forked from shijij/gist:54c9b21f26c08a15a70c182f03cb15b4
Created
July 3, 2018 04:03
-
-
Save patlachance/aa202a54b3e1f5fd3b145a028a39ca53 to your computer and use it in GitHub Desktop.
Nginx ssl reverse proxy with SNI
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
server { | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; | |
server_name yourdomain | |
ssl_certificate /etc/ssl/localcerts/yourdomain.crt; | |
ssl_certificate_key /etc/ssl/localcerts/yourdomain.key; | |
ssl_ecdh_curve prime256v1; | |
ssl_session_cache builtin:1000 shared:SSL:10m; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_prefer_server_ciphers on; | |
ssl_ciphers 'ECDHE+aECDSA+CHACHA20:ECDHE+aRSA+CHACHA20:ECDHE+aECDSA+AESGCM:ECDHE+aRSA+AESGCM:ECDHE+aECDSA+AES256+SHA384:ECDHE+aRSA+AES256+SHA384:ECDHE+aECDSA+AES256+SHA:ECDHE+aRSA+AES256+SHA'; | |
location / { | |
proxy_set_header Host $host; | |
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; | |
# Fix the “It appears that your reverse proxy set up is broken" error. | |
proxy_pass https://1.2.3.4; | |
proxy_read_timeout 60; | |
proxy_ssl_name $host; | |
proxy_ssl_server_name on; | |
proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
proxy_ssl_session_reuse off; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment