I’ve used NextCloud for a few years now on a traditional ISP with dynamic DNS, so I’m fairly familiar with how it works with an accessible port 80/443. My new ISP (T-Mobile 5G) is double NAT. I can reverse proxy to a local Flask development server using a VPS configured as described below, but NextCloud from the same server gives a 504 Gateway Time-out error.
My current setup works as follows:
- A VPS with static IP is connected to the internet, ports 80 and 443 are open.
- I use ZeroTier to create a link to my local network with my local server
- nginx is used to reverse-proxy VPS incoming connections to the ZeroTier IP of my local server:
server {
listen 80;
location / {
proxy_pass http://192.168.192.191;
}
}
server {
listen 443;
location / {
proxy_pass http://192.168.192.191:443;
}
}
- I run Flask to test the reverse proxy function, successfully accessing my local machine from the internet through the VPS static IP.
- I disable the Flask server and run NextCloud 22.2.0.2 on my local server with the VPS ZeroTier IP in trusted_proxies from NextCloud’s config.php.
- When I try to access NextCloud from:
- localhost IP: working
- ZeroTier IP of the local server from remote device also on ZeroTier: working (though this is not a trusted domain as currently configured so the appropriate warning appears)
- ZeroTier IP of the VPS from any device also on ZeroTier: not working (504 error)
- Static IP of the VPS from internet: not working (504 error)
I’m not forcing HTTPS anywhere yet so I would expect to see the HTTP site this way like on localhost/ZeroTier.
Has anybody tried this or have any suggestions? I’m very confused since the ports appear to be routing through the VPS properly. Thanks in advance!