server {
    listen       443 ssl;
    server_name  code.example.org;

    ssl_certificate      /etc/nginx/ssl/code.example.org.crt;
    ssl_certificate_key  /etc/nginx/ssl/code.example.org.key;

    # Optional
    ssl_protocols  TLSv1.2 TLSv1.3;
    ssl_ciphers    HIGH:!aNULL:!MD5;

    location / {
        proxy_pass        https://gitea.example.org;
        proxy_set_header  Host  gitea.example.org;

        # Optional but recommended
        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  https;

        # Only when the destination uses self-signed certs
        proxy_ssl_verify  off;
    }
}
