Created
July 20, 2018 20:22
-
-
Save jspaleta/6e4de6e135182f82c2491178105c25a9 to your computer and use it in GitHub Desktop.
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 8080 default_server; | |
listen [::]:8080 default_server; | |
server_name _; | |
root /usr/share/nginx/html; | |
# enable ssl encryption | |
ssl on; | |
ssl_certificate /etc/ssl/certs/nginx-proxy-selfsigned.crt; | |
ssl_certificate_key /etc/ssl/private/nginx-proxy-selfsigned.key; | |
ssl_session_cache shared:SSL:10m; | |
# Proxy only the results sensu api endpoint | |
location /results { | |
# use http basic auth | |
auth_basic "Restricted Access!"; | |
auth_basic_user_file /etc/nginx/conf.d/.htpasswd; | |
# forward on to sensu api endpoint | |
proxy_pass http://127.0.0.1:4567; | |
proxy_set_header Host $host; | |
# re-write redirects to http as to https, example: /home | |
proxy_redirect http:// https://; | |
} | |
error_page 404 /404.html; | |
location = /40x.html { | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment