typora/note/devops/nginx/gitea.md
2024-12-12 10:48:55 +08:00

721 B

nginx conf

server {
    listen [::]:8443 ssl ipv6only=on;
    server_name u20.heysq.com;
    ssl_certificate u20_ssl/u20.crt;
    ssl_certificate_key u20_ssl/u20.key;
    ssl_session_timeout 5m;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    ssl_prefer_server_ciphers on;

    error_page 497 https://$http_host$request_uri;
    client_max_body_size 500m;
    
    location /gitea/ {
        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;
    }
}