evertramos / nginx-proxy-automation

Automated docker nginx proxy integrated with letsencrypt.
MIT License
2.66k stars 632 forks source link

[BUG] SPA History Mode sub route 404 #395

Closed dolphin836 closed 7 months ago

dolphin836 commented 7 months ago

When our single-page application uses History mode routing, there is no problem in jumping to the sub-route from the home page, but a 404 error will occur when the sub-route is refreshed. Can it be solved by modifying the Nginx configuration file and adding

try_files $uri $uri/ /index.html

Where to add it specifically?

evertramos commented 7 months ago

I quiet didn´t understand what you mean... if you want to change the nginx settings that is not in our documentation, check the nginx-proxy documentation https://github.com/nginx-proxy/nginx-proxy.