# Docker setup with HOST ngnix reverse proxy - how to make it happen?

**URL:** <https://forum.gitea.com/t/docker-setup-with-host-ngnix-reverse-proxy-how-to-make-it-happen/12738>\
**Category:** Install/Maintain/Configure\
**Created:** [November 19, 2026, 2:29pm UTC](https://forum.gitea.com/t/docker-setup-with-host-ngnix-reverse-proxy-how-to-make-it-happen/12738 "2026-11-19T14:29:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![spgs04](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@spgs04](https://forum.gitea.com/u/spgs04)\
**Post date:** [November 19, 2026, 2:29pm UTC](https://forum.gitea.com/t/docker-setup-with-host-ngnix-reverse-proxy-how-to-make-it-happen/12738/1 "2026-11-19T14:29:07Z")

</div>

Using its own webserver via

ports:

- “8080:3000”

works fine, so issue.

```auto
gitea | 2026/11/19 13:34:10 cmd/web.go:346:listen() [I] LFS server enabled
gitea | 2026/11/19 13:34:10 modules/graceful/server.go:53:NewServer() [I] Starting new Web server: tcp:0.0.0.0:3000 on PID: 15
gitea | 2026/11/19 13:34:11 HTTPRequest [I] router: completed GET / for 10.10.9.3:20180, 200 OK in 60.0ms @ web/home.go:26(web.Home)

```

But want ngnix reverse proxy for SSL

```auto
http {

  server {
    listen 443;
    server_name git.internaldomain.com;
    ssl_certificate /etc/ssl/certs/git.crt;
    ssl_certificate_key /etc/ssl/private/git.key;
    ssl_protocols TLSv1.2 TLSv1.3;

    location / {
        client_max_body_size 512M;
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Connection $http_connection;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

```

```auto
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 10968/nginx: master
tcp 0 0 0.0.0.0:2221 0.0.0.0:* LISTEN 12427/docker-proxy
tcp 0 0 127.0.0.54:53 0.0.0.0:* LISTEN 613/systemd-resolve
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 613/systemd-resolve
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 12441/docker-proxy
tcp 0 0 10.10.9.146:22 0.0.0.0:* LISTEN 1/systemd
tcp6 0 0 :::2221 :::* LISTEN 12432/docker-proxy
tcp6 0 0 :::22 :::* LISTEN 1/systemd
tcp6 0 0 :::8080 :::* LISTEN 12446/docker-proxy
udp 0 0 127.0.0.54:53 0.0.0.0:* 613/systemd-resolve
udp 0 0 127.0.0.53:53 0.0.0.0:* 613/systemd-resolve
udp 0 0 10.10.9.146:68 0.0.0.0:* 919/systemd-network
udp 0 0 127.0.0.1:323 0.0.0.0:* 1206/chronyd
udp6 0 0 ::1:323 :::* 1206/chronyd

```

But I only get error in logs

```auto
2026/11/19 09:29:39 [error] 6312#6312: *7 connect() failed (111: Connection refused) while connecting to upstream, client: 10.10.9.3, server: git.internaldomain.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "git.internaldomain.com"

```

Any help would be appreciated, thanks

Or shall I run dcocker ngnix with the other two?

---

<div class="post-metadata">

**Author:** ![joshuajohnson](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@joshuajohnson](https://forum.gitea.com/u/joshuajohnson)\
**Post date:** [December 2, 2026, 6:36pm UTC](https://forum.gitea.com/t/docker-setup-with-host-ngnix-reverse-proxy-how-to-make-it-happen/12738/2 "2026-12-02T18:36:51Z")

</div>

Your nginx is proxying to the container’s internal port 3000 on the host, but Docker only published 8080. Point proxy\_pass at the host’s published port 8080, or put nginx and Gitea on the same Docker network and proxy to the Gitea service name on port 3000. The connection-refused error matches nothing listening on host port 3000. If you later run nginx in Docker, use the compose service name rather than the host loopback.

---

<div class="post-metadata">

**Author:** ![blenser4](https://avatars.discourse-cdn.com/v4/letter/b/bbce88/32.png) [@blenser4](https://forum.gitea.com/u/blenser4)\
**Post date:** [December 3, 2026, 12:03am UTC](https://forum.gitea.com/t/docker-setup-with-host-ngnix-reverse-proxy-how-to-make-it-happen/12738/3 "2026-12-03T00:03:25Z")

</div>

That makes sense. If the host only publishes 8080, the proxy should point there instead of the container port. Checking the published port first would save a lot of guessing.
