linuxhttpnginxraspberry-pimastodon

Can connect to nginx server inside LAN but not publicly


I'm trying to set up a Mastodon instance on my Raspberry Pi 4 at home, running Raspbian/Debian Linux. I have no idea what I'm doing.

The nginx server is running, working. When I access it from localhost or from inside the LAN, it gives a result like this, as expected:

enter image description here

When I try to access it from outside the LAN, it eventually times out or gives a "connection was reset" error.

enter image description here

Or in firefox:

enter image description here

At first I suspected that it was a problem with my firewall, like maybe it was blocking HTTP traffic into it. But it's allowing HTTP traffic through. I even stopped the firewall entirely, but it's still doing the same thing. (I'm using IPTables)

enter image description here

All of the necessary ports should be forwarded to the pi on my optimum router:

enter image description here

Here's the site's nginx config, just an edited copy of mastodon's given nginx configuration template. I have the HTTPS server commented out, as I'm only working with HTTP right now. I'm trying to get the http server working so I can use certbot to get an SSL certificate, but certbot's unable to connect to the nginx server, runs into the same "connection reset" error. The server_name is irrelevant (or is it?) as i'm just trying to connect to it through IP right now, and commented out the other "location" properties that the template came with, as I'm just trying to get the server to work in the first place, running mastodon on it and getting the SSL certificate and getting the domain to work will come after.

enter image description here

What causes it to work inside LAN but not outside it? Even with the necessary ports forwarded to the pi?

Edit: Here's what it looks like inside the LAN, working correctly: enter image description here

and here's when I try to access it outside the LAN (through ProtonVPN in this case)

enter image description here


Solution

  • https://www.reddit.com/r/OPTIMUM/comments/rxjw1v/optimum_internet_not_forwarding_traffic_on_port_80/ By default, Optimum blocks ports 80 and 25, even if they are port-forwarded.

    Optimum support referred me to this obscure page that I couldn't find linked anywhere on the site, did exactly what i needed: https://www.optimum.net/internet/boost/