moderator edit: This comment is possibly AI or spam due to how it needed to be modified
Hi everyone,
I’ve been working on deploying Gitea (self-hosted) on a private VPS and running into some roadblocks with the reverse proxy and HTTPS setup. I’ve followed the official documentation and a few community guides, but I still can’t get things working quite right.
Here’s a quick overview of my setup:
- Gitea version: 1.21.11
- Server: Ubuntu 22.04
- Reverse proxy: Nginx
- SSL: Let’s Encrypt (via Certbot)
- Installed Gitea as a service using the Linux binary
I’ve configured my domain and DNS correctly (A record pointing to server IP), and HTTPS certificates were successfully generated via Certbot. However, when I try to access Gitea via https://mydomain.com
, I either get a 502 Bad Gateway error or the Gitea UI doesn’t load properly (CSS/js issues). The instance works fine on localhost via port 3000.
Here’s a snippet of my Nginx config:
nginx
CopyEdit
location / {
proxy_pass http://localhost:3000;
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;
}
And in my app.ini
, I’ve set:
ini
CopyEdit
ROOT_URL = https://mydomain.com/
PROTOCOL = http
Thanks in advance.