Skip to content

Instantly share code, notes, and snippets.

@JulienSansot
Created March 5, 2015 00:16
Show Gist options
  • Save JulienSansot/07710f50a90060af9ac2 to your computer and use it in GitHub Desktop.
Save JulienSansot/07710f50a90060af9ac2 to your computer and use it in GitHub Desktop.
nginx config for proxy with certificate and Basic Auth
#
# 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