Browse Source

更新 'default.conf'

胡增文 5 months ago
parent
commit
cb000a8e42
1 changed files with 15 additions and 0 deletions
  1. 15 0
      default.conf

+ 15 - 0
default.conf

@@ -1,3 +1,8 @@
+upstream backed_server {
+      server 192.168.6.251:8080 max_fails=1 fail_timeout=10s;
+      server 192.168.3.251:8080 max_fails=1 fail_timeout=10s;
+}
+
 server {
     listen       80;
     server_name  localhost;
@@ -19,6 +24,16 @@ server {
         index  start.html index.html;
     }
     
+    location /api {
+        proxy_read_timeout 300;
+        proxy_pass http://backed_server;
+    }
+    
+    location /ws {
+        proxy_read_timeout 300;
+        proxy_pass http://backed_server;
+    }
+    
     # location /api {
     #     proxy_read_timeout 300;
     #     proxy_pass   http://192.168.3.177:8080;