From 3993f7322e3477ba73566d50fb1f138416ef74bc Mon Sep 17 00:00:00 2001 From: whm <973418690@qq.com> Date: Tue, 17 Mar 2026 21:36:30 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B7=BB=E5=8A=A0=20nginx=20=E5=AE=B9?= =?UTF-8?q?=E5=99=A8=E7=94=A8=E9=85=8D=E7=BD=AE=20yuheng.docker.conf?= =?UTF-8?q?=EF=BC=88=E4=BB=85=20443=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made-with: Cursor --- nginx/yuheng.docker.conf | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 nginx/yuheng.docker.conf diff --git a/nginx/yuheng.docker.conf b/nginx/yuheng.docker.conf new file mode 100644 index 0000000..bcf87be --- /dev/null +++ b/nginx/yuheng.docker.conf @@ -0,0 +1,41 @@ +# 供 docker-compose 中 nginx 使用:仅监听 443,反代到 api/web/admin;证书挂载到 /etc/ssl/yh_web/yuheng.yuxindazhineng.com/ + +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name yuheng.yuxindazhineng.com; + + ssl_certificate /etc/ssl/yh_web/yuheng.yuxindazhineng.com/fullchain.pem; + ssl_certificate_key /etc/ssl/yh_web/yuheng.yuxindazhineng.com/privkey.pem; + ssl_session_timeout 1d; + ssl_session_cache shared:SSL:50m; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384; + + location / { + proxy_pass http://web:80; + 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; + } + + location /admin/ { + proxy_pass http://admin:80/; + 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; + } + + location /api/ { + proxy_pass http://api:9527/; + 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; + } +}