浏览代码

更新 'default.conf'

胡增文 2 月之前
父节点
当前提交
cb000a8e42
共有 1 个文件被更改,包括 15 次插入0 次删除
  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;