-
-
Notifications
You must be signed in to change notification settings - Fork 107
Blank page when using nginx reverse proxy with a path for self host #383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @nulshell, Thank you for the details. Could you please check if there are any errors in the browser console when you visit the blank page Or even better, a minimal reproductible example? |
Hi CorentinTh, The following is the output of Errors and Warning in firefox console:
In chrome console: I also tried the following command:
Same messages appeared in the console, and same blank page in the browser window. Thanks. |
Hi CorentinTh, I assigned a new sub domain and added a server in nginx instead of the path method, and it’s working fine now. So you don’t have to make it work with path if you don’t have time. Thanks, :-) Best, |
Hey @CorentinTh , Any idea why this might be happening? |
I went though the code, I was able to deduce the following:
I tried hardcoding it and it kinda worked, but vite doesn't do suffix replace so was the perfect fix, on top of that we cannot mention process environment variable in the vite config as they won't be present at the time of packing. 😰 I am not a FE dev, so don't have much clue on how vite works. Lemme know if there is a fix for this, this was fun. |
Hey @CorentinTh, With using the new PUBLIC_VIEW_NOTE_PATH_PREFIX feature from #418, I have also the issue that only a blank page is displayed using nginx and only allowing access to the configured subpath. |
Thanks @wakille 🙏 It's a tricky subject, I haven't taken the time to dig this, but a good candidate may be using vite relative url config |
Describe the bug
Hi CorentinTh, thanks for the great work. I tried to self host it on my vps with the docker method. For https access I tried to use nginx reverse proxy and a path, for example, "www.example.com/enclosed" directing to 127.0.0.1:8787, as I had a www.example.com page on the "/" path already. And they can share the same ssl keys.
Added part in nginx.conf:
...
location /enclosed {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://127.0.0.1:8787; # Enclosed
}
...
Then for the docker, I ran$(id -u):$ (id -g) -e PUBLIC_BASE_API_URL="https://www.example.com/enclosed" corentinth/enclosed:latest-rootless
sudo docker run -d --name enclosed --restart unless-stopped -p 8787:8787 -v /home/apps/enclosed:/app/.data --user
When visiting www.example.com/enclosed, it shows a blank page. How to make it right? Thanks.
What happened?
When visiting www.example.com/enclosed, it only shows a blank page.
System information
The self host docker is running on an ARM vps running debian 12, with nginx/1.27.3 to use with Xray 1.8.24. DNS translation for "www.example.com" is on cloudflare, with proxy check on.
Firefox and chrome was tried on a local win10 pc to visit the website.
Where did you encounter the bug?
A self hosted instance
The text was updated successfully, but these errors were encountered: