Files
test/nginx/nginx.conf
zhengdongxiang c3b3c8fcd9 fix
2025-08-06 09:54:51 +08:00

36 lines
1017 B
Nginx Configuration File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

events {}
http {
server {
listen 80;
server_name _; # 或你的域名
# HTTP自动跳转HTTPS可选
# return 301 https://$host$request_uri;
client_max_body_size 200m;
location / {
proxy_pass http://gitea:3000; # 3000 为 gitea 服务端口gitea 是docker-compose服务名
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;
}
}
server {
listen 443 ssl;
server_name gitea.lexinshengwen.com;
ssl_certificate /etc/nginx/ssl/certificate.crt;
ssl_certificate_key /etc/nginx/ssl/private.key;
location / {
proxy_pass http://gitea:3000; # 注意此处用服务名gitea
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;
}
}
}