1

I have a gitea server listening on public IP 111.222.333.444, port 3000. If I open http://111.222.333.444:3000 on my browser, I can access normally.

I have an nginx server running on 999.888.777.666. I have domain registered, and the DNS specifies that mysubdomain.example.com points to 999.888.777.666.

In the nginx server config, I have included the following entrance:

server {
    listen 80;
    server_name mysubdomain.example.com;

    location / {
        proxy_pass http://111.222.333.444:3000;
        proxy_set_header Host $host;
        proxy_redirect off;
    }
}

If I access http://mysubdomain.example.com through my browser, I can't access my gitea server. But, if I access http://mysubdomain.example.com:3000, I can successfully reach the server.

Actually, I can remove the port from the nginx config and leave it like this, and my browser experience remains unchanged:

server {
    listen 80;
    server_name mysubdomain.example.com;

    location / {
        proxy_pass http://111.222.333.444;
        proxy_set_header Host $host;
        proxy_redirect off;
    }
}

Why is this happening?

An additional note: I have other reverse proxies set up in this same nginx server in the same fashion that work just fine, with no need to specify the port on top of the subdomain.

What am I doing wrong? What should I change to be able to reach my gitea server on http://mysubdomain.example.com with no need to specify the port?

Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58
Pablo M
  • 111
  • 2
  • check `lsof -in :3000,443,80` and also provide the output native of `nginx -T -t` – djdomi Sep 10 '22 at 16:35
  • 1
    "I can't access my gitea server". Please provide the exact response you get when you try to access the server. – Tero Kilkanen Sep 10 '22 at 21:43
  • Do `ping $domainname` _on the same machine as the browser (or `getent hosts $domainname` if Unix); what address do you get? If your browser is set to use a proxy either manually or by something like WPAD and that proxy is on a different machine, check it also. – dave_thompson_085 Sep 11 '22 at 04:23

0 Answers0