Created
January 22, 2020 17:30
-
-
Save bahamat/be689ea4dbf7f28a0bc13cecf62a566b to your computer and use it in GitHub Desktop.
nginx reverse proxy for adminui
This file contains hidden or 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
# include this file from nginx.conf inside the http stanza. | |
server { | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; | |
server_name adminui.example.com; | |
access_log /var/log/nginx/adminui.access.log bunyan; | |
error_log /var/log/nginx/adminui.error.log; | |
ssl_certificate /opt/ssl/certs/rproxy.example.com/fullchain.pem; | |
ssl_certificate_key /opt/ssl/certs/rproxy.example.com/privkey.pem; | |
ssl_dhparam /opt/ssl/dhparam.pem; | |
ssl_protocols TLSv1.1 TLSv1.2; | |
ssl_prefer_server_ciphers on; | |
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"; | |
ssl_session_timeout 10m; | |
ssl_session_cache shared:SSL:10m; | |
ssl_session_tickets off; | |
ssl_stapling on; | |
ssl_stapling_verify on; | |
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"; | |
add_header X-Frame-Options DENY; | |
#add_header X-Content-Type-Options nosniff; | |
add_header X-XSS-Protection "1; mode=block"; | |
add_header X-Robots-Tag none; | |
location / { | |
resolver ip.of.cns.server; | |
proxy_pass_header server; | |
proxy_pass_header date; | |
proxy_set_header Host $host; | |
proxy_set_header Forwarded "for=$remote_addr; proto=$scheme; by=$server_addr"; | |
proxy_set_header X-Forwarded-For "$remote_addr"; | |
proxy_pass https://adminui.us-west-1.cns.example.com; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment