From 81759eba0fa1d392799b6d5f0dff552f5b7632e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=BF=E9=98=B3?= <997485446@qq.com> Date: Mon, 29 Jan 2024 14:00:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20'docs/conf/conf.d/default.?= =?UTF-8?q?conf'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/conf/conf.d/default.conf | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 docs/conf/conf.d/default.conf diff --git a/docs/conf/conf.d/default.conf b/docs/conf/conf.d/default.conf new file mode 100644 index 0000000..a405919 --- /dev/null +++ b/docs/conf/conf.d/default.conf @@ -0,0 +1,31 @@ +server{ + listen 80; + server_name localhost; + client_max_body_size 1020M; + root /usr/share/nginx/html/public; + index index.html index.htm; + + location / { + 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-Client-Verify SUCCESS; + proxy_set_header X-Client-DN $ssl_client_s_dn; + proxy_set_header X-SSL-Subject $ssl_client_s_dn; + proxy_set_header X-SSL-Issuer $ssl_client_i_dn; + proxy_read_timeout 1800; + proxy_connect_timeout 1800; + client_max_body_size 1020M; + try_files $uri $uri/ /index.html; + + + add_header Access-Control-Allow-Origin $http_origin; + add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; + add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; + + if ($request_method = 'OPTIONS') { + return 204; + } + } + +} \ No newline at end of file