Created
April 29, 2014 11:38
-
-
Save homburg/11397664 to your computer and use it in GitHub Desktop.
Minimal nginx proxy setup with forced ssl
This file contains 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
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