Spaces:
Sleeping
Sleeping
Update nginx.conf
Browse files- nginx.conf +31 -7
nginx.conf
CHANGED
|
@@ -15,13 +15,17 @@ http {
|
|
| 15 |
default_type application/octet-stream;
|
| 16 |
|
| 17 |
sendfile on;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
client_max_body_size 800m;
|
| 20 |
|
| 21 |
access_log /tmp/nginx-access.log;
|
| 22 |
|
| 23 |
# =====================================================
|
| 24 |
-
#
|
| 25 |
# =====================================================
|
| 26 |
client_body_temp_path /tmp/nginx-client-body;
|
| 27 |
proxy_temp_path /tmp/nginx-proxy-temp;
|
|
@@ -29,29 +33,43 @@ http {
|
|
| 29 |
uwsgi_temp_path /tmp/nginx-uwsgi-temp;
|
| 30 |
scgi_temp_path /tmp/nginx-scgi-temp;
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
server {
|
| 33 |
|
| 34 |
listen 7860;
|
| 35 |
server_name _;
|
| 36 |
|
| 37 |
# =================================================
|
| 38 |
-
# MAIN
|
| 39 |
# =================================================
|
| 40 |
location / {
|
| 41 |
|
| 42 |
-
proxy_pass http://127.0.0.1:
|
| 43 |
|
| 44 |
proxy_http_version 1.1;
|
| 45 |
|
| 46 |
proxy_set_header Host $host;
|
| 47 |
proxy_set_header Upgrade $http_upgrade;
|
| 48 |
-
proxy_set_header Connection
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
proxy_cache_bypass $http_upgrade;
|
| 51 |
}
|
| 52 |
|
| 53 |
# =================================================
|
| 54 |
-
#
|
| 55 |
# =================================================
|
| 56 |
location /vscode/ {
|
| 57 |
|
|
@@ -64,11 +82,17 @@ http {
|
|
| 64 |
|
| 65 |
proxy_set_header Host $host;
|
| 66 |
proxy_set_header Upgrade $http_upgrade;
|
| 67 |
-
proxy_set_header Connection
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
proxy_cache_bypass $http_upgrade;
|
| 70 |
}
|
| 71 |
|
| 72 |
-
error_page 502
|
| 73 |
}
|
| 74 |
}
|
|
|
|
| 15 |
default_type application/octet-stream;
|
| 16 |
|
| 17 |
sendfile on;
|
| 18 |
+
tcp_nopush on;
|
| 19 |
+
tcp_nodelay on;
|
| 20 |
+
|
| 21 |
+
keepalive_timeout 65;
|
| 22 |
|
| 23 |
client_max_body_size 800m;
|
| 24 |
|
| 25 |
access_log /tmp/nginx-access.log;
|
| 26 |
|
| 27 |
# =====================================================
|
| 28 |
+
# HF SPACES TEMP DIR FIX
|
| 29 |
# =====================================================
|
| 30 |
client_body_temp_path /tmp/nginx-client-body;
|
| 31 |
proxy_temp_path /tmp/nginx-proxy-temp;
|
|
|
|
| 33 |
uwsgi_temp_path /tmp/nginx-uwsgi-temp;
|
| 34 |
scgi_temp_path /tmp/nginx-scgi-temp;
|
| 35 |
|
| 36 |
+
# =====================================================
|
| 37 |
+
# UPGRADE HEADER FIX
|
| 38 |
+
# =====================================================
|
| 39 |
+
map $http_upgrade $connection_upgrade {
|
| 40 |
+
default upgrade;
|
| 41 |
+
'' close;
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
server {
|
| 45 |
|
| 46 |
listen 7860;
|
| 47 |
server_name _;
|
| 48 |
|
| 49 |
# =================================================
|
| 50 |
+
# MAIN ROOT -> OPENVSCODE
|
| 51 |
# =================================================
|
| 52 |
location / {
|
| 53 |
|
| 54 |
+
proxy_pass http://127.0.0.1:5050/;
|
| 55 |
|
| 56 |
proxy_http_version 1.1;
|
| 57 |
|
| 58 |
proxy_set_header Host $host;
|
| 59 |
proxy_set_header Upgrade $http_upgrade;
|
| 60 |
+
proxy_set_header Connection $connection_upgrade;
|
| 61 |
+
|
| 62 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 63 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
| 64 |
+
|
| 65 |
+
proxy_read_timeout 86400;
|
| 66 |
+
proxy_send_timeout 86400;
|
| 67 |
|
| 68 |
proxy_cache_bypass $http_upgrade;
|
| 69 |
}
|
| 70 |
|
| 71 |
# =================================================
|
| 72 |
+
# OPTIONAL /vscode PATH
|
| 73 |
# =================================================
|
| 74 |
location /vscode/ {
|
| 75 |
|
|
|
|
| 82 |
|
| 83 |
proxy_set_header Host $host;
|
| 84 |
proxy_set_header Upgrade $http_upgrade;
|
| 85 |
+
proxy_set_header Connection $connection_upgrade;
|
| 86 |
+
|
| 87 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 88 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
| 89 |
+
|
| 90 |
+
proxy_read_timeout 86400;
|
| 91 |
+
proxy_send_timeout 86400;
|
| 92 |
|
| 93 |
proxy_cache_bypass $http_upgrade;
|
| 94 |
}
|
| 95 |
|
| 96 |
+
error_page 502 /502.html;
|
| 97 |
}
|
| 98 |
}
|