From 9ef7ae6d2b0e8facac2f2bfae0020082c968bfad Mon Sep 17 00:00:00 2001 From: taoshihan1991 <630892807@qq.com> Date: Fri, 26 Feb 2021 11:50:05 +0800 Subject: [PATCH] =?UTF-8?q?nginx=E9=83=A8=E7=BD=B2=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- readme.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/readme.md b/readme.md index 05327b3..bbccd12 100644 --- a/readme.md +++ b/readme.md @@ -157,7 +157,12 @@ server { #listen 80; server_name gofly.sopans.com; access_log /var/log/nginx/gofly.sopans.com.access.log main; + location /static { + root /var/www/html/go-fly;//自己的部署路径 + } location / { + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; proxy_pass http://127.0.0.1:8081; proxy_http_version 1.1; proxy_set_header X-Real-IP $remote_addr; @@ -170,7 +175,12 @@ server{ listen 80; server_name gofly.sopans.com; access_log /var/log/nginx/gofly.sopans.com.access.log main; + location /static { + root /var/www/html/go-fly;//自己的部署路径 + } location / { + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; proxy_pass http://127.0.0.1:8081; proxy_http_version 1.1; proxy_set_header X-Real-IP $remote_addr;