Skip to content

Instantly share code, notes, and snippets.

@ishults
Last active October 25, 2016 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ishults/375335240fdc0c6560d0f4e6e23ecbaf to your computer and use it in GitHub Desktop.
Save ishults/375335240fdc0c6560d0f4e6e23ecbaf to your computer and use it in GitHub Desktop.
sudo nano /etc/nginx/sites-enabled/default
# Add
server {
listen 80;
server_name example.com; # Your site
proxy_buffering off;
location / {
auth_basic "Home Assistant";
auth_basic_user_file /etc/nginx/.htpasswd; # Your .htpasswd file
proxy_pass http://127.0.0.1:8123/; # The server you want to redirect to
proxy_set_header Host $host;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment