Skip to content

Instantly share code, notes, and snippets.

@jspaleta
Created July 20, 2018 20:22
Show Gist options
  • Save jspaleta/6e4de6e135182f82c2491178105c25a9 to your computer and use it in GitHub Desktop.
Save jspaleta/6e4de6e135182f82c2491178105c25a9 to your computer and use it in GitHub Desktop.
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