From 116bdb6354454c8d9e0cf4c7a112a1bcd6d62d26 Mon Sep 17 00:00:00 2001 From: dompling <374779789@qq.com> Date: Mon, 18 Oct 2021 09:29:22 +0800 Subject: [PATCH] =?UTF-8?q?nginx=20=E6=9C=8D=E5=8A=A1=E5=99=A8=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/nginx/front.conf | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 web/nginx/front.conf diff --git a/web/nginx/front.conf b/web/nginx/front.conf new file mode 100644 index 0000000..1311488 --- /dev/null +++ b/web/nginx/front.conf @@ -0,0 +1,40 @@ +upstream api { + server 0.0.0.0:3000; +} + +server { + listen 5700; +# allow 127.0.0.1; +# allow 0.0.0.0; +# deny all; + + gzip on; + gzip_static on; + gzip_types text/plain application/json application/javascript application/x-javascript text/css application/xml text/javascript; + gzip_proxied any; + gzip_vary on; + gzip_comp_level 6; + gzip_buffers 16 8k; + gzip_http_version 1.0; + + location / { + root /Sub-Store/web/dist; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + + location /api { + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_pass http://api; + } + + location /download { + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_pass http://api; + } + +} \ No newline at end of file