Blazor WebAssembly nginx server returns HTML on *.css or *.js files

Viewed 567

I'm having a hard time figuring out why the resources such as css and js files are returned as same as the index.html: enter image description here

Like in the picture, each of those GET calls return the content of index.html instead of the original content. Meanwhile my nginx configuration looks like this:

server {
    server_name <DOMAIN>;
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    add_header X-Frame-Options "SAMEORIGIN";
    #add_header X-Content-Type-Options "nosniff";
    add_header X-Robots-Tag "none";
    add_header X-Download-Options "noopen";
    add_header X-Permitted-Cross-Domain-Policies "none";
    add_header X-XSS-Protection "1;mode=block";
    add_header Strict-Transport-Security "max-age=15552000; includeSubDomains";
    add_header Referrer-Policy "no-referrer";
    client_max_body_size 1G;
    location /ん尺 {
        root /var/www/<DOMAIN>;
        try_files $uri $uri/ /index.html =404;
        index index.html;
        gzip_static on;
        gzip_http_version 1.1;
        gzip_vary on;
        gzip_comp_level 6;
        gzip_types *;
        gzip_proxied    no-cache no-store private expired auth;
        gzip_min_length 1000;
        default_type application/octet-stream;
    }
 
  include /etc/nginx/ssl.conf;
  ssl_certificate /etc/letsencrypt/live/<DOMAIN>/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/<DOMAIN>/privkey.pem;
}

As you can see the path is not / but /ん尺 because the / path is running something else. And at the same my index.html base is <base href="/ん尺/"> so the resources point correctly in the beginning.

Is there something wrong with my setup?

0 Answers
Related