Skip to content

Instantly share code, notes, and snippets.

@homburg
Created April 29, 2014 11:38
Show Gist options
  • Save homburg/11397664 to your computer and use it in GitHub Desktop.
Save homburg/11397664 to your computer and use it in GitHub Desktop.
Minimal nginx proxy setup with forced ssl
server {
listen 80;
server_name some-service.example.org;
location / {
rewrite ^(.*)$ https://some-service.example.org$1 permanent;
}
}
server {
listen 443 ssl;
server_name some-service.example.org;
ssl_certificate "cert/star.example.org";
ssl_certificate_key "cert/star.example.org";
location / {
auth_basic "Auth zone";
auth_basic_user_file "includes/htpasswd";
# Service listening on localhost
proxy_pass http://127.0.0.1:7859;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment