Open Rod-O opened 3 years ago
I am having the same problem! @Rod-O have you figured out how to redirect to index.html for SPA apps?
No, I just use 2.9.9
hei @Rod-O , I found a solution, works in v2.9.13 (now latest) also. Enter this in your Advanced Custom Nginx Configuration:
proxy_intercept_errors on;
error_page 404 /index.html;
location = /index.html {
proxy_pass http://your-docker-service-or-internal-ip;
}
Replace the proxy_pass with your app. I don't know if this is the best solution but this is all I have working. Hope this will help you and others that have the same problem !
Does the issue still exist in 2.9.13?
@dodanex tested a workaround for 2.9.13, which means that still exists in 2.9.13
I've tried debugging why this error occurs for the past hour but unfortunately I was not able to find anything and have no clue what might cause this
what's your environment ? set a redirect on your main app page to a route like in a classic react app (not on the proxy manager) www.example.com -> www.example.com/main/section
Also, try to deactivate Force SSL and HTTP/2 Support and try again to see if it works. I had some problems with v2.9.12 because of that, but on a different VPS I use v2.9.13 with those options activated and it works.
I am using a random website, currently based.cooking and proxying that. I have added the error page to be /rss.xml
and am able to replicate the issue that way. However I am not finding the source of this issue. I have both force ssl and http 2 support disabled, so that can't be the issue.
In case anyone without a SPA wants to replicate this, here is my full server config block I use:
server {
set $forward_scheme https;
set $server "based.cooking";
set $port 443;
listen 80;
listen [::]:80;
server_name test1.npm.local;
access_log /data/logs/proxy-host-1_access.log proxy;
error_log /data/logs/proxy-host-1_error.log warn;
proxy_intercept_errors on;
error_page 404 = /rss.xml;
location / {
# Proxy!
include conf.d/include/proxy.conf;
}
}
Issue is now considered stale. If you want to keep it open, please comment :+1:
Checklist
jc21/nginx-proxy-manager:latest
docker image?Describe the bug I have this code on Advanced tab-> Custom Nginx Configuration that accounts for SPA routes
This was working on 2.9.9, upgraded to latest and now I have 404
Nginx Proxy Manager Version 2.9.12
To Reproduce Steps to reproduce the behavior:
Expected behavior Simple page reload