# HAProxy Proxy-Protocol Support / Internal Server Error Decoding Failed

**URL:** <https://forum.gitea.com/t/haproxy-proxy-protocol-support-internal-server-error-decoding-failed/11985>\
**Category:** Install/Maintain/Configure\
**Created:** [February 23, 2026, 4:58pm UTC](https://forum.gitea.com/t/haproxy-proxy-protocol-support-internal-server-error-decoding-failed/11985 "2026-02-23T16:58:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zyzonix](https://avatars.discourse-cdn.com/v4/letter/z/ecccb3/32.png) [@zyzonix](https://forum.gitea.com/u/zyzonix)\
**Post date:** [February 23, 2026, 4:58pm UTC](https://forum.gitea.com/t/haproxy-proxy-protocol-support-internal-server-error-decoding-failed/11985/1 "2026-02-23T16:58:50Z")

</div>

Hello,

I tried setting up Gitea behind a HAProxy. The HAProxy is making the encryption, so that every communication behind it, is without encryption.

The problem is now, that I want to use the proxy-protocol v1 so that I can see for example the original client IP.

Accessing the webinterface works normal, but when trying to push something from CLI or creating a file via the webinterface the following error appears:

```auto
error: Internal Server Error Decoding Failed

```

Unfortunately there is no more information in the journal. When completely removing the proxy protocol and switching back to X-Forward everything works flawless.

The config files look like this:

/etc/gitea/app.ini

```auto
[server]
SSH_DOMAIN = gitea.tld
DOMAIN = gitea.tld
HTTP_PORT = 3000
ROOT_URL = https://gitea.tld/
APP_DATA_PATH = /var/lib/gitea/data
DISABLE_SSH = true
LFS_START_SERVER = true
LFS_JWT_SECRET = <KEY>
OFFLINE_MODE = true
USE_PROXY_PROTOCOL = true

[security]
INSTALL_LOCK = true
INTERNAL_TOKEN = <KEY>
PASSWORD_HASH_ALGO = pbkdf2

```

haproxy.cfg

```auto
backend gitea
        mode http
        server gitea 10.0.0.12:3000 send-proxy check

frontend web
        mode http
        # Redirect to SSL
        http-request redirect scheme https code 301 if !{ ssl_fc } 

        # Set X-Fordwarded-Proto when using SSL
        http-request add-header X-Forwarded-Proto https if { ssl_fc }

        # Remove Server header
                
        # gitea
        use_backend gitea if { hdr(Host) -i gitea.tld }

```

Is there a configuration issue or is it a general problem of gitea? During installation I followed the documentation on [docs.gitea.com/administration/reverse-proxies](https://docs.gitea.com/administration/reverse-proxies)

Thanks in advance!
