Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95419

Nginx to HA frontend was working but not now - howto debug?

$
0
0

@ninjadog wrote:

I’ve setup nginx on a Digital Ocean droplet with an attached domain, that is also running a VPN server. Its VPN IP is 10.19.49.1
I was able to successfully point my browser to my domain xyz.com (droplet) and nginx redirected it to a VPN client 10.19.49.2 running HA. It all worked and I could use the lovelace UI.
Excellent.

But

Then I installed fail2ban and tried various mods to the /etc/nginx/sites-enabled/default. Now all I get is the standard nginx greeting page - like when you first install nginx. I’ve done something to break it. I’ve tried uninstalling fail2ban and nginx, then reinstalling just nginx. No effect - still same. It used to work that’s the PITA.

This is my setup , but it’s not working. I guess I need to debug it somehow, but I dont know how. Strange, is that whatever I put in the location in the nginx default file, doest do anything.

configuration.yaml

http:
  base_url: https://xyz.com
  use_x_forwarded_for: true
  trusted_proxies: 10.19.49.1 #-- my DO droplet's VPN IP

/etc/nginx/sites-enabled/default

map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

server {
    server_name xyz.com;
    listen [::]:80 default_server ipv6only=off;
    return 301 https://$host$request_uri;
}

server {
    server_name xyz.com;
    ssl_certificate /etc/letsencrypt/live/xyz.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/xyz.com/privkey.pem;

    listen [::]:443 ssl default_server ipv6only=off;
    add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
    ssl on;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;

    proxy_buffering off;

    location / {
        proxy_pass http://10.19.49.2:8123;  #-- My VPN client running HA
        proxy_set_header Host $host;
        proxy_redirect http:// https://;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
    }
}

How do I debug whats going on?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95419

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>