HA+NGINX Proxy do not work anymore - No Login

Since the last update, the nginx proxy no longer works for the home assistant,
and I can no longer log in.

Everything works perfectly locally and via tunnel and also with the Android app
and with browsers where the Javascript files are in the browser cache.

I can access all other applications (Grafana, influxdb, local HTML pages) via the
NGINX proxy without any problems. Only the home assistant doesn’t work.

SSL certificate is valid, server is online and accessible via the Internet

ERRORS 404 NOT FOUND.

mha.ddns.net/:1 Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: https://mha.ddns.net/frontend_latest/core.XdmzaKFA4yc.js
mha.ddns.net/:1 Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: https://mha.ddns.net/frontend_latest/app.otA1ToECPHw.js
mha.ddns.net/:1 Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: https://mha.ddns.net/hacsfiles/lovelace-card-mod/card-mod.js
mha.ddns.net/:1 Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: https://mha.ddns.net/hacsfiles/iconset.js
mha.ddns.net/:1 Error while trying to use the following icon from the Manifest: https://mha.ddns.net/static/icons/favicon-192x192.png (Download error or resource isn't a valid image)

NGINX PROXY CONFIG:

# ----------------------------------------------------------------------
# | HOME_ASSISTANT NGINX PROXY CONFIGURTION                            |
# ----------------------------------------------------------------------

## local homeassistant
upstream homeassistant {
    server 10.1.1.198:8123;
    keepalive 64;
}

# Apply fix for very long server names
server_names_hash_bucket_size 128;


## default server port 80 redirect to 443
server {
    listen 80;
    server_name mha.ddns.net;
	server_tokens off;
    return 301 https://mha.ddns.net$request_uri;
}

# SERVER HTTPS configuration with certificates from letsencrypt
server  {

    ## ------------------------------------
    ## serverport, protocoll and servername
    ## ------------------------------------
    listen      443 ssl http2;
    listen      [::]:443 ssl http2;
    server_name mha.ddns.net;
	server_tokens off;
		 
    ## ------------------------------------
    ## SSL SETTINGS certificate files
    ## ------------------------------------
    include snippets/ssl/ssl_engine.conf;
    include snippets/ssl/certificate_files.conf;
    include snippets/ssl/policy_modern.conf;

    ## ------------------------------------
    ## Media types
    ## ------------------------------------
    include /etc/nginx/mime.types;
    default_type  application/octet-stream;
	gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
	
    # -------------------------------------
    # Logging and other settings
    # -------------------------------------
    include snippets/location/general.conf;
    access_log /var/log/nginx/smart_home.log main;
    error_log /var/log/nginx/smart_home_error.log notice;

	resolver 10.1.1.129 10.1.1.254 10.1.1.129 10.1.1.254;
	
	# Homeassistant
    location / {	
        proxy_cache off;
        proxy_set_header Host $host;
        proxy_http_version 1.1;
        proxy_set_header X-Real-IP       $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Upgrade         $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_cache_bypass $http_upgrade;
		proxy_set_header Proxy "";
		proxy_pass http://homeassistant;
    }

	# Homeassistant websocket
    location /api/websocket {
      proxy_set_header Host $host;
      proxy_http_version 1.1;
      proxy_set_header X-Real-IP       $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Upgrade         $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_cache_bypass $http_upgrade;
      add_header Access-Control-Allow-Origin "*";
	  proxy_pass http://homeassistant/api/websocket;
    }

	# Homeassistant Alexa briefings
    location /api/alexa/flash_briefings/ {
        allow all;
        proxy_set_header Host $host;
        proxy_redirect http:// https://;
        proxy_http_version 1.1;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header Upgrade           $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_cache_bypass $http_upgrade;
        add_header Access-Control-Allow-Origin "*";
		proxy_pass http://homeassistant;
    }

	# Homeassitant Alexa Smarthome skill
    location /api/alexa/smart_home {
        allow all;
        proxy_set_header Host $host;
        proxy_redirect http:// https://;
        proxy_http_version 1.1;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_cache_bypass $http_upgrade;
        add_header Access-Control-Allow-Origin "*";
		proxy_pass http://homeassistant/api/alexa/smart_home;
    }

}

Homeassistant

  • Core 2023.12.4
  • Frontend 20231208.2
  • nginx version: nginx/1.22.0 (Ubuntu)

NGINX DEBUG LOG

Why is it that the files are out of the directory /usr/share/nginx/html/frontend_lates/app.otA1ToECPHw.js are be loaded ?

2023/12/28 13:59:32 [debug] 3901760#3901760: *7 http filename: "/usr/share/nginx/html/frontend_latest/app.otA1ToECPHw.js"
2023/12/28 13:59:32 [debug] 3901760#3901760: *7 add cleanup: 00005646427549D0
2023/12/28 13:59:32 [error] 3901760#3901760: *7 open() "/usr/share/nginx/html/frontend_latest/app.otA1ToECPHw.js" failed (2: No such file or directory), client: 192.168.178.1, server: mha.ddns.net, request: "GET /frontend_latest/app.otA1ToECPHw.js HTTP/2.0", host: "mha.ddns.net"
2023/12/28 13:59:32 [debug] 3901760#3901760: *7 http finalize request: 404, "/frontend_latest/app.otA1ToECPHw.js?" a:1, c:1
2023/12/28 13:59:32 [debug] 3901760#3901760: *7 http special response: 404, "/frontend_latest/app.otA1ToECPHw.js?"

API Calls are working, also alexa briefings and alexa skills:

curl -X GET -H "Authorization: Bearer TOKEN" -H "Content-Type: application/json" https://mha.ddns.net/api/states/sensor.air_ikea1_luftwert

{
   "entity_id":"sensor.air_ikea1_luftwert",
   "state":"Sehr schlecht",
   "attributes":{
      "icon":"mdi:blur",
      "friendly_name":"air-ikea1 Luftwert"
   },
   "last_changed":"2023-12-28T11:51:21.726683+00:00",
   "last_updated":"2023-12-28T11:51:21.726683+00:00",
   "context":{
      "id":"01HJR47JBYWQBM7W75E10S7Z6F",
      "parent_id":null,
      "user_id":null
   }
}

I haven’t found a solution for days and would be happy if someone could help me.

Thanks.