server {
    listen 80;
    server_name git.zat.kz;
    location /.well-known/acme-challenge/ { root /var/www/html; }

    # Forgejo can serve large pushes; allow big request bodies.
    client_max_body_size 512M;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        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;
        proxy_buffering off;
        proxy_request_buffering off;
        proxy_read_timeout 300s;
    }
}
# Note: run certbot --nginx -d git.zat.kz to issue a TLS cert — certbot will
# add a TLS server block and rewrite this one to 301->https.
