Improve the reverse-proxies documentation #14841

Closed
opened 2025-11-02 11:24:11 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @johny-mnemonic on GitHub (Aug 7, 2025).

Description

While following the documentation for reverse-proxies I have configured my Nginx using the NginxProxyManager and ended with the same 400 bad request error as reported in https://github.com/go-gitea/gitea/issues/31141

For me it also helped to remove the proxy_set_header Host $host; directive and after quite a lot of searching I have found why.

The NginxProxyManager is adding some directives for a custom location by default and looks like Nginx is not happy if you specify the Host header twice.

Could you please update the documentation mentioning to only include following directives when using NginxProxyManager?

client_max_body_size 512M;
proxy_set_header Connection $http_connection;
proxy_set_header Upgrade $http_upgrade;

Or maybe just mention that 400 bad request might be caused by double definition of the proxy_set_header Host $host; coming from custom Nginx server configuration?

Whatever will help others that might stumble into the same trap 🤞

Gitea Version

1.24.4

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

I am running Gitea in docker swarm with the NPM running on Proxmox server.

Database

None

Originally created by @johny-mnemonic on GitHub (Aug 7, 2025). ### Description While following the documentation for [reverse-proxies](https://docs.gitea.com/administration/reverse-proxies) I have configured my Nginx using the NginxProxyManager and ended with the same `400 bad request` error as reported in https://github.com/go-gitea/gitea/issues/31141 For me it also helped to remove the `proxy_set_header Host $host;` directive and after quite a lot of searching I have found why. The NginxProxyManager is [adding some directives](https://github.com/NginxProxyManager/nginx-proxy-manager/blob/master/docker/rootfs/etc/nginx/conf.d/include/proxy.conf) for a custom location by default and looks like Nginx is not happy if you specify the Host header twice. Could you please update the documentation mentioning to only include following directives when using NginxProxyManager? ``` client_max_body_size 512M; proxy_set_header Connection $http_connection; proxy_set_header Upgrade $http_upgrade; ``` Or maybe just mention that `400 bad request` might be caused by double definition of the `proxy_set_header Host $host;` coming from custom Nginx server configuration? Whatever will help others that might stumble into the same trap 🤞 ### Gitea Version 1.24.4 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? I am running Gitea in docker swarm with the NPM running on Proxmox server. ### Database None
GiteaMirror added the issue/needs-feedbacktype/bug labels 2025-11-02 11:24:11 -06:00
Author
Owner

@TheFox0x7 commented on GitHub (Aug 7, 2025):

Docs are tracked in separate repository (https://gitea.com/gitea/docs), could you file an issue or submit a PR with note about it there?

@TheFox0x7 commented on GitHub (Aug 7, 2025): Docs are tracked in separate repository (https://gitea.com/gitea/docs), could you file an issue or submit a PR with note about it there?
Author
Owner

@GiteaBot commented on GitHub (Sep 7, 2025):

We close issues that need feedback from the author if there were no new comments for a month. 🍵

@GiteaBot commented on GitHub (Sep 7, 2025): We close issues that need feedback from the author if there were no new comments for a month. :tea:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14841