From c2055d912bebbd488be97e213ec1e8f000ef0dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=BF=E9=98=B3?= <997485446@qq.com> Date: Thu, 1 Feb 2024 10:54:44 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20'docs/nginx.conf'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/nginx.conf | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 docs/nginx.conf diff --git a/docs/nginx.conf b/docs/nginx.conf new file mode 100644 index 0000000..41df276 --- /dev/null +++ b/docs/nginx.conf @@ -0,0 +1,37 @@ +user nginx; +worker_processes auto; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + + +events { + worker_connections 20480; +} + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + fastcgi_buffer_size 128k; + fastcgi_buffers 256 16k; + client_max_body_size 1020m; + client_body_buffer_size 1024k; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + gzip on; + + include /etc/nginx/conf.d/*.conf; + +} \ No newline at end of file From d712f6700c1963ed1586e610e120a147efba5a1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=BF=E9=98=B3?= <997485446@qq.com> Date: Thu, 1 Feb 2024 10:55:48 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20'docs/conf/conf.d/defa?= =?UTF-8?q?ult.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 From e0828ce56b675d6a0b16d8b801d5cfc4b3ebf418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=BF=E9=98=B3?= <997485446@qq.com> Date: Thu, 1 Feb 2024 10:56:14 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'docs/conf/nginx.conf'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/{ => conf}/nginx.conf | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/{ => conf}/nginx.conf (100%) diff --git a/docs/nginx.conf b/docs/conf/nginx.conf similarity index 100% rename from docs/nginx.conf rename to docs/conf/nginx.conf From 2fe3c66b0b21d361614ad688aba6d753907a07a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=BF=E9=98=B3?= <997485446@qq.com> Date: Thu, 1 Feb 2024 10:57:44 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20'DockerfileSlim'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DockerfileSlim | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 DockerfileSlim diff --git a/DockerfileSlim b/DockerfileSlim new file mode 100644 index 0000000..908852f --- /dev/null +++ b/DockerfileSlim @@ -0,0 +1,8 @@ +FROM nginx + +COPY ./dist/ /usr/share/nginx/html/public/ + +COPY ./docs/conf/nginx.conf /etc/nginx/nginx.conf +COPY ./docs/conf/conf.d/ /etc/nginx/conf.d/ + +ENTRYPOINT ["nginx","-g","daemon off;"] \ No newline at end of file