瀏覽代碼

Конфиг nginx

Book Pauk 3 年之前
父節點
當前提交
8829bb3810
共有 2 個文件被更改,包括 26 次插入4 次删除
  1. 13 2
      docs/beta/beta.omnireader
  2. 13 2
      docs/beta/beta.omnireader_http

+ 13 - 2
docs/beta/beta.omnireader

@@ -6,6 +6,7 @@ server {
   ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
 
   server_name beta.omnireader.ru;
+  set $liberama http://127.0.0.1:34081;
 
   client_max_body_size 50m;
   proxy_read_timeout 1h;
@@ -15,15 +16,20 @@ server {
   gzip_proxied expired no-cache no-store private auth;
   gzip_types *;
 
+  location @liberama {
+    proxy_pass $liberama;
+  }
+
   location /api {
-    proxy_pass http://127.0.0.1:34081;
+    proxy_pass $liberama;
   }
 
   location /ws {
-    proxy_pass http://127.0.0.1:34081;
+    proxy_pass $liberama;
     proxy_http_version 1.1;
     proxy_set_header Upgrade $http_upgrade;
     proxy_set_header Connection "upgrade";
+    proxy_read_timeout 600s;
   }
 
   location / {
@@ -32,6 +38,11 @@ server {
     location /tmp {
       types { } default_type "application/xml; charset=utf-8";
       add_header Content-Encoding gzip;
+      try_files $uri @liberama;
+    }
+
+    location /upload {
+      try_files $uri @liberama;
     }
 
     location ~* \.(?:manifest|appcache|html)$ {

+ 13 - 2
docs/beta/beta.omnireader_http

@@ -1,6 +1,7 @@
 server {
   listen 80;
   server_name beta.omnireader.ru;
+  set $liberama http://127.0.0.1:34081;
 
   client_max_body_size 50m;
   proxy_read_timeout 1h;
@@ -10,15 +11,20 @@ server {
   gzip_proxied expired no-cache no-store private auth;
   gzip_types *;
 
+  location @liberama {
+    proxy_pass $liberama;
+  }
+
   location /api {
-    proxy_pass http://127.0.0.1:34081;
+    proxy_pass $liberama;
   }
 
   location /ws {
-    proxy_pass http://127.0.0.1:34081;
+    proxy_pass $liberama;
     proxy_http_version 1.1;
     proxy_set_header Upgrade $http_upgrade;
     proxy_set_header Connection "upgrade";
+    proxy_read_timeout 600s;
   }
 
   location / {
@@ -27,6 +33,11 @@ server {
     location /tmp {
       types { } default_type "application/xml; charset=utf-8";
       add_header Content-Encoding gzip;
+      try_files $uri @liberama;
+    }
+
+    location /upload {
+      try_files $uri @liberama;
     }
 
     location ~* \.(?:manifest|appcache|html)$ {