PYAE1994 commited on
Commit
b530b5f
·
verified ·
1 Parent(s): aca7e7a

Update nginx.conf

Browse files
Files changed (1) hide show
  1. nginx.conf +27 -28
nginx.conf CHANGED
@@ -1,6 +1,6 @@
1
  user user;
2
 
3
- error_log /tmp/error.log warn;
4
  pid /tmp/nginx.pid;
5
 
6
  worker_processes auto;
@@ -24,18 +24,18 @@ http {
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;
32
- fastcgi_temp_path /tmp/nginx-fastcgi-temp;
33
- uwsgi_temp_path /tmp/nginx-uwsgi-temp;
34
- scgi_temp_path /tmp/nginx-scgi-temp;
35
-
36
- # =====================================================
37
- # WEBSOCKET / UPGRADE FIX
38
- # =====================================================
39
  map $http_upgrade $connection_upgrade {
40
  default upgrade;
41
  '' close;
@@ -46,17 +46,13 @@ http {
46
  listen 7860;
47
  server_name _;
48
 
49
- # =================================================
50
- # GLOBAL AUTH (FULL SITE PROTECTION)
51
- # =================================================
52
- auth_basic "Restricted";
53
-
54
- auth_basic_user_file /home/user/app/ngpasswd;
55
 
56
- # =================================================
57
- # ROOT -> OPENVSCODE
58
- # =================================================
59
- location / {
60
 
61
  proxy_pass http://127.0.0.1:5050/;
62
 
@@ -75,10 +71,10 @@ http {
75
  proxy_cache_bypass $http_upgrade;
76
  }
77
 
78
- # =================================================
79
- # OPTIONAL DIRECT /vscode PATH
80
- # =================================================
81
- location /vscode/ {
82
 
83
  proxy_pass http://127.0.0.1:5050/;
84
 
@@ -97,6 +93,9 @@ http {
97
  proxy_cache_bypass $http_upgrade;
98
  }
99
 
100
- error_page 502 /502.html;
 
 
 
101
  }
102
  }
 
1
  user user;
2
 
3
+ error_log /tmp/nginx-error.log warn;
4
  pid /tmp/nginx.pid;
5
 
6
  worker_processes auto;
 
24
 
25
  access_log /tmp/nginx-access.log;
26
 
27
+ # ================================
28
+ # HF SAFE TEMP PATHS
29
+ # ================================
30
+ client_body_temp_path /tmp/nginx-body;
31
+ proxy_temp_path /tmp/nginx-proxy;
32
+ fastcgi_temp_path /tmp/nginx-fastcgi;
33
+ uwsgi_temp_path /tmp/nginx-uwsgi;
34
+ scgi_temp_path /tmp/nginx-scgi;
35
+
36
+ # ================================
37
+ # WEBSOCKET SUPPORT
38
+ # ================================
39
  map $http_upgrade $connection_upgrade {
40
  default upgrade;
41
  '' close;
 
46
  listen 7860;
47
  server_name _;
48
 
49
+ # ================================
50
+ # AUTH ONLY FOR VS CODE AREA
51
+ # ================================
52
+ location /vscode/ {
 
 
53
 
54
+ auth_basic "Restricted";
55
+ auth_basic_user_file /home/user/app/ngpasswd;
 
 
56
 
57
  proxy_pass http://127.0.0.1:5050/;
58
 
 
71
  proxy_cache_bypass $http_upgrade;
72
  }
73
 
74
+ # ================================
75
+ # MAIN APP (OPEN WITHOUT AUTH)
76
+ # ================================
77
+ location / {
78
 
79
  proxy_pass http://127.0.0.1:5050/;
80
 
 
93
  proxy_cache_bypass $http_upgrade;
94
  }
95
 
96
+ # ================================
97
+ # ERROR HANDLING
98
+ # ================================
99
+ error_page 502 = /;
100
  }
101
  }