From 2242fca8761ca2e933717e893f9181805716f564 Mon Sep 17 00:00:00 2001 From: Bruce Chen <805899926@qq.com> Date: Tue, 24 Dec 2024 21:20:42 +0800 Subject: [PATCH] # adjust nginx --- .../app/nginx/node/base/conf/conf.d/openwrt.conf | 13 +++++++------ server/prod/nginx/conf/conf.d/home.conf | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/server/docker/app/nginx/node/base/conf/conf.d/openwrt.conf b/server/docker/app/nginx/node/base/conf/conf.d/openwrt.conf index 5fd9f1f8..a9debff0 100644 --- a/server/docker/app/nginx/node/base/conf/conf.d/openwrt.conf +++ b/server/docker/app/nginx/node/base/conf/conf.d/openwrt.conf @@ -20,8 +20,11 @@ server { ssl_certificate /etc/nginx/cert/czy21.com.pem; ssl_certificate_key /etc/nginx/cert/czy21.com.key; - - add_header Access-Control-Allow-Origin *; + + add_header 'Access-Control-Allow-Credentials' 'true' always; + add_header 'Access-Control-Allow-Headers' * always; + add_header 'Access-Control-Allow-Methods' * always; + add_header 'Access-Control-Allow-Origin' 'https://openwrt-firmware.czy21.com' always; location / { proxy_pass http://192.168.2.18:8081; @@ -38,17 +41,15 @@ server { ssl_certificate_key /etc/nginx/cert/czy21.com.key; add_header 'Access-Control-Allow-Credentials' 'true' always; - add_header 'Access-Control-Allow-Origin' 'https://openwrt-firmware.czy21.com' always; - add_header 'Access-Control-Allow-Methods' * always; add_header 'Access-Control-Allow-Headers' * always; + add_header 'Access-Control-Allow-Methods' * always; + add_header 'Access-Control-Allow-Origin' 'https://openwrt-firmware.czy21.com' always; if ($request_method = 'OPTIONS') { return 204; } - location / { - proxy_pass http://192.168.2.12:8000; } diff --git a/server/prod/nginx/conf/conf.d/home.conf b/server/prod/nginx/conf/conf.d/home.conf index a347b098..6bbd581d 100644 --- a/server/prod/nginx/conf/conf.d/home.conf +++ b/server/prod/nginx/conf/conf.d/home.conf @@ -118,7 +118,7 @@ server { server { http2 on; listen 443 ssl; - server_name openwrt-download.czy21.com openwrt-firmware.czy21.com openwrt-asu.czy21.com; + server_name openwrt-download.czy21.com openwrt-firmware.czy21.com; include /etc/nginx/conf.d/czy21-ssl.conf;