0

I normally access HA via https://home.lan:8123 and it works fine but I would like to access via https://home-assistant.home

accessing https://home-assistant.home I get nothing at all

If I only do http I can login but HA fails after login.

I have set HA external url to https://home-assistant.home

My hosts file in my router

home.lan 192.168.8.67
home-assistant.home 192.168.8.67

my nginx conf is

# HOME ASSISTANT
server {

    listen 443;

    server_name home-assistant.home;

    location / {
      
      access_log /var/log/nginx/access.log;
      error_log  /var/log/nginx/error.log;

      proxy_ssl_server_name on;

      proxy_set_header        Host $host;
      proxy_set_header        X-Real-IP $remote_addr;

      proxy_pass          https://home.lan:8123;
      proxy_read_timeout  90;

      proxy_redirect      https://home-assistant.home https://home.lan:8123;
    }
}

nginx error logs:

2024/06/16 14:15:41 [notice] 1#1: using the "epoll" event method
2024/06/16 14:15:41 [notice] 1#1: nginx/1.27.0
2024/06/16 14:15:41 [notice] 1#1: built by gcc 12.2.0 (Debian 12.2.0-14)
2024/06/16 14:15:41 [notice] 1#1: OS: Linux 6.6.31+rpt-rpi-v8
2024/06/16 14:15:41 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2024/06/16 14:15:41 [notice] 1#1: start worker processes
2024/06/16 14:15:41 [notice] 1#1: start worker process 28
2024/06/16 14:15:41 [notice] 1#1: start worker process 29
2024/06/16 14:15:41 [notice] 1#1: start worker process 30
2024/06/16 14:15:41 [notice] 1#1: start worker process 31

nginx access log

192.168.8.112 - - [16/Jun/2024:14:13:55 +0200] "GET /ggpht/ytc/AIdro_lmZYYus5mKFrWbz-zuviAiNOsTMM-0vW7mpikM7mNAQQ=s88-c-k-c0x00ffffff-no-rj HTTP/1.1" 200 2447 "http://youtube.home/watch?v=Ya2r_oZPesM&autoplay=1&continue=1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15" "-"
192.168.8.112 - - [16/Jun/2024:14:13:55 +0200] "GET /ggpht/S_UlAJIBD55VejNCPWbqVJRlL5ZHDPBuCr3ceqpsma16_r0aUznSFQSUkQv3icL9oqhrLw2W=s88-c-k-c0x00ffffff-no-rj HTTP/1.1" 200 3725 "http://youtube.home/watch?v=Ya2r_oZPesM&autoplay=1&continue=1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15" "-"
192.168.8.112 - - [16/Jun/2024:14:13:55 +0200] "GET /ggpht/ytc/AIdro_lt0GxivS_4_0uVhuCdhqfrXcrk1i8aPJHZ8boFfYw=s88-c-k-c0x00ffffff-no-rj HTTP/1.1" 200 1382 "http://youtube.home/watch?v=Ya2r_oZPesM&autoplay=1&continue=1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15" "-"
192.168.8.112 - - [16/Jun/2024:14:13:55 +0200] "GET /ggpht/ytc/AIdro_mkDd-hQCP44p-75hLfHyk8V7usXEtGGXxlsQjv2BjdqEE=s88-c-k-c0x00ffffff-no-rj HTTP/1.1" 200 3282 "http://youtube.home/watch?v=Ya2r_oZPesM&autoplay=1&continue=1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Safari/605.1.15" "-"
192.168.8.112 - - [16/Jun/2024:14:15:54 +0200] "\x16\x03\x01\x02\x00\x01\x00\x01\xFC\x03\x03\x91\xF5\xBC\xB5\xF9\x89\x96\x9EnEk\xFA\xDA\xBFF7Cv\xB1I>Y|'6Ox#\xD0\xC1\x8B\x05 b\xC6\x15b\x83\x09\xB3\xE0\xCE\xEB\x13\xAA\x9A\x0E\xFB\x96\xEE\x80Q\xDFGh\xF9f\xD9\xF0U\x00\x1F=\x036\x00***\x13\x01\x13\x02\x13\x03\xC0,\xC0+\xCC\xA9\xC00\xC0/\xCC\xA8\xC0" 400 157 "-" "-" "-"
192.168.8.112 - - [16/Jun/2024:14:15:54 +0200] "\x16\x03\x01\x02\x00\x01\x00\x01\xFC\x03\x03\xD0\x85Q\x10\xA1\xF0\x01\xB9\xA0\x05\xD6\xD7\x0C@\x83\x998\xA7\xE1+\xB3\xE0\x172\x8B\xA6/\x7F\x90\x86I| \x0E\xE98\xE1\x87\xBC\x86\xBD\xBD\x04\xB9\xB8!\xF6\xA7\x05?,;\x02c\x1BG\xAE\x1A(?\xC8\xE4\xD5\xF7\xB0\x00,JJ\x13\x01\x13\x02\x13\x03\xC0,\xC0+\xCC\xA9\xC00\xC0/\xCC\xA8\xC0" 400 157 "-" "-" "-"
192.168.8.112 - - [16/Jun/2024:14:15:54 +0200] "\x16\x03\x01\x00\x99\x01\x00\x00\x95\x03\x01\xFES\xEF\xF8\x92+>\x12\xA3X\xBF&\x9A\xAB\x94A\xC1\xC2\xF7\xFD\xEA\xC6\x9D)\xE3\xCE\x16\xD9\xECM\x7F\xD7\x00\x00\x14\xC0" 400 157 "-" "-" "-"
192.168.8.112 - - [16/Jun/2024:14:15:54 +0200] "\x16\x03\x01\x02\x00\x01\x00\x01\xFC\x03\x03\xDAK\x83\xD6\xEE\xBA\xA77\xC3\x11\x87\xBAb\x801\x10\xE23\xD0Vd\x0C\xC81\x1EO\xC8\x88\x06\x9E\xD7p \xBC\xF3\xBBl\xE6\xF7\xE9^*\x86Fm\xFEu\xF3y\x0C\xDA\x1B+(\x06%\xC2\xC1y[U<S\xC9\xB7\x00*\xFA\xFA\x13\x01\x13\x02\x13\x03\xC0,\xC0+\xCC\xA9\xC00\xC0/\xCC\xA8\xC0" 400 157 "-" "-" "-"
192.168.8.112 - - [16/Jun/2024:14:15:54 +0200] "\x16\x03\x01\x02\x00\x01\x00\x01\xFC\x03\x03\xD1^t\xA5}h\xD8Z\x12JX\x86\x06\xD3w\x1A\xF3\x84\xD7t\xFC\xA4\x05\xF4\xCEc\x9B\x8F\x9E@\xF3\xEB #\x22\xD7A\x8C\xD5\xA3%\x81>\xDF\x8E\x86gd\xB7\x22\x11a\xA7\xFB\xB9\x06\x842\x9Db\xF7^\xA4(\x9B\x00,\xCA\xCA\x13\x01\x13\x02\x13\x03\xC0,\xC0+\xCC\xA9\xC00\xC0/\xCC\xA8\xC0" 400 157 "-" "-" "-"
192.168.8.112 - - [16/Jun/2024:14:15:54 +0200] "\x16\x03\x01\x00\x99\x01\x00\x00\x95\x03\x01\xB2=U\x07m,E\x94\xF2\xC6&\x15\x11)\x8E\x8Fb\xB8\x9A-\xF8\x1C\x08\x92U\x01l\x0B|\x5C\xFF\x99\x00\x00\x14\xC0" 400 157 "-" "-" "-"

1 Answer 1

0

With those logs talking more about docker than nginx itself. It's hard to know what's exactly causing this. Try posting /var/log/nginx/error.log.

As you are reverse proxying an https link, You can try using the proxy_ssl_server_name on; option inside your location block to allow nginx to establish TLS connections.

3
  • I added the line and separated the logs but still the same. I updated my question with modifications
    – jotyhista
    Commented Jun 16 at 12:19
  • does the nginx machine resolves the domains you've created in your hosts files? If it is only in your router's /etc/hosts, it won't work. It must be added in all the machines you want to resolve to that. An alternative to this is to set up a local dns server
    – montepinar
    Commented Jun 16 at 12:40
  • well.. It works if http only (can login but HA does not load after so HA issue) and it works with all my other services so I don't think I need any more hosts files
    – jotyhista
    Commented Jun 16 at 13:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .