Created
March 5, 2015 00:16
-
-
Save JulienSansot/07710f50a90060af9ac2 to your computer and use it in GitHub Desktop.
nginx config for proxy with certificate and Basic Auth
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
# | |
# Example of nginx config to proxy the port 443 to port 7547 | |
# Adding a certificate and Basic Auth in the process | |
# | |
server { | |
listen 443; | |
server_name abc.def.example.com; | |
ssl on; | |
ssl_certificate /path/of/cert.crt; | |
ssl_certificate_key /path/of/cert.key; | |
access_log /var/log/nginx/example.log combined; | |
error_log /var/log/nginx/example.log; | |
location / { | |
auth_basic "abc"; | |
auth_basic_user_file /etc/nginx/ms-htpasswd; | |
proxy_set_header Authorization ""; | |
proxy_pass http://127.0.0.1:7547; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment