Skip to content

Instantly share code, notes, and snippets.

@SvenJ31
Forked from JulienSansot/nginx-site-conf
Last active August 29, 2015 14:22
Show Gist options
  • Select an option

  • Save SvenJ31/048a5d66391d9e1b47a1 to your computer and use it in GitHub Desktop.

Select an option

Save SvenJ31/048a5d66391d9e1b47a1 to your computer and use it in GitHub Desktop.
#
# 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