If you get the above error when pushing to Gitea (I was doing via HTTPS and my Gitea server is behind a web server and uses the FastCGI protocol) check if you have the following in your config:
LOCAL_ROOT_URL = %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/
If so remove everything after the
= sign so the variable is empty.
The official docs, and the config file, have a warning saying it be left empty if we are using the
unix socket protocol. Guess that applies to