Skip to content

Blank page when using nginx reverse proxy with a path for self host #383

Open
@nulshell

Description

@nulshell

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
sudo docker run -d --name enclosed --restart unless-stopped -p 8787:8787 -v /home/apps/enclosed:/app/.data --user $(id -u):$(id -g) -e PUBLIC_BASE_API_URL="https://www.example.com/enclosed" corentinth/enclosed:latest-rootless

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions