|
@@ -5,7 +5,7 @@ upstream myapp {
|
|
|
|
|
|
server {
|
|
server {
|
|
listen 80;
|
|
listen 80;
|
|
- server_name ai.manage.daoguyujia.com;
|
|
|
|
|
|
+ server_name ai.manage.daoguyujia.com manage.daogu.ai;
|
|
client_max_body_size 500M;
|
|
client_max_body_size 500M;
|
|
|
|
|
|
location / {
|
|
location / {
|
|
@@ -20,6 +20,9 @@ server {
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ # 强制跳转到 HTTPS
|
|
|
|
+ return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
|
|
server {
|
|
server {
|
|
@@ -28,7 +31,7 @@ server {
|
|
|
|
|
|
location / {
|
|
location / {
|
|
index index.html;
|
|
index index.html;
|
|
- root /home/FrontendSys/dist;
|
|
|
|
|
|
+ root /home/BackendFront/dist;
|
|
# Vue 路由设置
|
|
# Vue 路由设置
|
|
try_files $uri $uri/ /index.html;
|
|
try_files $uri $uri/ /index.html;
|
|
# 允许跨域
|
|
# 允许跨域
|
|
@@ -52,9 +55,8 @@ server {
|
|
proxy_pass http://myapp/api/sse/;
|
|
proxy_pass http://myapp/api/sse/;
|
|
proxy_http_version 1.1;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
- proxy_set_header Connection "upgrade";
|
|
|
|
- proxy_read_timeout 10s;
|
|
|
|
- proxy_send_timeout 10s;
|
|
|
|
|
|
+ proxy_read_timeout 300s;
|
|
|
|
+ proxy_send_timeout 300s;
|
|
proxy_buffering off;
|
|
proxy_buffering off;
|
|
proxy_cache off;
|
|
proxy_cache off;
|
|
proxy_set_header Connection "";
|
|
proxy_set_header Connection "";
|
|
@@ -64,7 +66,7 @@ server {
|
|
|
|
|
|
server {
|
|
server {
|
|
listen 443 ssl;
|
|
listen 443 ssl;
|
|
- server_name ai.manage.daoguyujia.com;
|
|
|
|
|
|
+ server_name ai.manage.daoguyujia.com manage.daogu.ai;
|
|
|
|
|
|
ssl_certificate /root/.acme.sh/ai.manage.daoguyujia.com/fullchain.cer;
|
|
ssl_certificate /root/.acme.sh/ai.manage.daoguyujia.com/fullchain.cer;
|
|
ssl_certificate_key /root/.acme.sh/ai.manage.daoguyujia.com/ai.manage.daoguyujia.com.key;
|
|
ssl_certificate_key /root/.acme.sh/ai.manage.daoguyujia.com/ai.manage.daoguyujia.com.key;
|
|
@@ -75,14 +77,14 @@ server {
|
|
|
|
|
|
location / {
|
|
location / {
|
|
index index.html;
|
|
index index.html;
|
|
- root /home/FrontendSys/dist;
|
|
|
|
|
|
+ root /home/BackendFront/dist;
|
|
# Vue 路由设置
|
|
# Vue 路由设置
|
|
try_files $uri $uri/ /index.html;
|
|
try_files $uri $uri/ /index.html;
|
|
- proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
- proxy_set_header Host $http_host;
|
|
|
|
- proxy_set_header X-NginX-Proxy true;
|
|
|
|
- proxy_redirect off;
|
|
|
|
|
|
+ # 允许跨域
|
|
|
|
+ add_header Access-Control-Allow-Headers *;
|
|
|
|
+ add_header Access-Control-Allow-Origin $http_origin always;
|
|
|
|
+ add_header Access-Control-Allow-Methods 'GET,POST,OPTIONS';
|
|
|
|
+ add_header Access-Control-Allow-Credentials 'true';
|
|
}
|
|
}
|
|
|
|
|
|
# 接口代理配置 (Vue项目代理)
|
|
# 接口代理配置 (Vue项目代理)
|
|
@@ -99,12 +101,11 @@ server {
|
|
proxy_pass http://myapp/api/sse/;
|
|
proxy_pass http://myapp/api/sse/;
|
|
proxy_http_version 1.1;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
- proxy_set_header Connection "upgrade";
|
|
|
|
- proxy_read_timeout 10s;
|
|
|
|
- proxy_send_timeout 10s;
|
|
|
|
|
|
+ proxy_read_timeout 300s;
|
|
|
|
+ proxy_send_timeout 300s;
|
|
proxy_buffering off;
|
|
proxy_buffering off;
|
|
proxy_cache off;
|
|
proxy_cache off;
|
|
proxy_set_header Connection "";
|
|
proxy_set_header Connection "";
|
|
}
|
|
}
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ }
|