0

Can someone help me out why nginx returns a 403 Unauthorized for .js files, but other files work:

I have a file /etc/nginx/sites-available/my-server.nl:

server { listen 80 proxy_protocol; server_name my-server.nl; location / { proxy_pass http://localhost:8080/; proxy_http_version 1.1; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/my-server.nl/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/my-server.nl/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot } server { if ($host = my-server.nl) { return 301 https://$host$request_uri; } # managed by Certbot listen 80 proxy_protocol; server_name my-server.nl; return 404; # managed by Certbot } 

I have a docker container running on port 8080, and everything works when I go to localhost:8080 and use my application.

However, when I go to my-server.nl, I get an 403 Unauthorized when the .js files are loaded. But all other files (.css, favicon etc) work just fine.

The application is a spring boot application with angular as frontend.

I've tried everything, but I can't get it to work

1
  • Maybe need to fix on Spring Boot side? In this case need to show Java code Commented Nov 12 at 7:40

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.