Elysiadev11 commited on
Commit
1194941
·
verified ·
1 Parent(s): edfe3a2

Update nginx.conf.template.txt

Browse files
Files changed (1) hide show
  1. nginx.conf.template.txt +76 -59
nginx.conf.template.txt CHANGED
@@ -2,77 +2,94 @@ worker_processes auto;
2
  pid /tmp/nginx.pid;
3
 
4
  events {
5
- worker_connections 1024;
6
  }
7
 
8
  http {
9
- access_log /dev/stdout;
10
- error_log /dev/stderr info;
11
- include /etc/nginx/mime.types;
12
- default_type application/octet-stream;
13
- sendfile on;
14
- tcp_nodelay on;
15
 
16
- map $http_upgrade $connection_upgrade {
17
- default upgrade;
18
- '' close;
19
- }
20
 
21
- server {
22
- listen ${PROXY_PORT};
23
- server_name _;
24
- client_max_body_size 0;
25
 
26
- proxy_http_version 1.1;
27
- proxy_set_header Host $host;
28
- proxy_set_header X-Real-IP $remote_addr;
29
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
30
- proxy_set_header X-Forwarded-Proto $scheme;
31
- proxy_set_header Authorization "Bearer ${OPENCLAW_GATEWAY_PASSWORD}";
32
- proxy_set_header Upgrade $http_upgrade;
33
- proxy_set_header Connection $connection_upgrade;
34
- proxy_read_timeout 86400;
35
- proxy_send_timeout 86400;
36
- proxy_buffering off;
37
 
38
- location = /tg-webhook {
39
- proxy_set_header Authorization "";
40
- proxy_pass http://127.0.0.1:8787/tg-webhook;
41
- proxy_buffering off;
42
- proxy_connect_timeout 60s;
43
- proxy_send_timeout 60s;
44
- proxy_read_timeout 60s;
45
- }
46
 
47
- location /tg-webhook/ {
48
- proxy_set_header Authorization "";
49
- proxy_pass http://127.0.0.1:8787/tg-webhook/;
50
- proxy_buffering off;
51
- proxy_connect_timeout 60s;
52
- proxy_send_timeout 60s;
53
- proxy_read_timeout 60s;
54
- }
55
 
56
- location ~ ^/proxy/([0-9]+)/(.*)$ {
57
- proxy_set_header X-Forwarded-Prefix /proxy/$1;
58
- proxy_pass http://127.0.0.1:$1/$2$is_args$args;
59
- }
60
 
61
- location ~ ^/proxy/([0-9]+)$ {
62
- return 308 /proxy/$1/;
63
- }
 
 
 
 
 
 
 
 
 
64
 
65
- location ~ ^/([0-9]+)/(.*)$ {
66
- proxy_set_header X-Forwarded-Prefix /$1;
67
- proxy_pass http://127.0.0.1:$1/$2$is_args$args;
68
- }
69
 
70
- location ~ ^/([0-9]+)$ {
71
- return 308 /$1/;
72
- }
 
 
 
 
 
 
 
 
 
73
 
74
- location / {
75
- proxy_pass http://127.0.0.1:${OPENCLAW_PORT};
 
76
  }
77
- }
78
  }
 
2
  pid /tmp/nginx.pid;
3
 
4
  events {
5
+ worker_connections 1024;
6
  }
7
 
8
  http {
9
+ access_log /dev/stdout;
10
+ error_log /dev/stderr info;
11
+ include /etc/nginx/mime.types;
12
+ default_type application/octet-stream;
13
+ sendfile on;
14
+ tcp_nodelay on;
15
 
16
+ map $http_upgrade $connection_upgrade {
17
+ default upgrade;
18
+ '' close;
19
+ }
20
 
21
+ server {
22
+ listen ${PROXY_PORT};
23
+ server_name _;
24
+ client_max_body_size 0;
25
 
26
+ proxy_http_version 1.1;
27
+ proxy_set_header Host $host;
28
+ proxy_set_header X-Real-IP $remote_addr;
29
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
30
+ proxy_set_header X-Forwarded-Proto $scheme;
31
+ proxy_set_header Authorization "Bearer ${OPENCLAW_GATEWAY_PASSWORD}";
32
+ proxy_set_header Upgrade $http_upgrade;
33
+ proxy_set_header Connection $connection_upgrade;
34
+ proxy_read_timeout 86400;
35
+ proxy_send_timeout 86400;
36
+ proxy_buffering off;
37
 
38
+ location = /tg-webhook {
39
+ proxy_set_header Authorization "";
40
+ proxy_pass http://127.0.0.1:8787/tg-webhook;
41
+ proxy_buffering off;
42
+ proxy_connect_timeout 60s;
43
+ proxy_send_timeout 60s;
44
+ proxy_read_timeout 60s;
45
+ }
46
 
47
+ location /tg-webhook/ {
48
+ proxy_set_header Authorization "";
49
+ proxy_pass http://127.0.0.1:8787/tg-webhook/;
50
+ proxy_buffering off;
51
+ proxy_connect_timeout 60s;
52
+ proxy_send_timeout 60s;
53
+ proxy_read_timeout 60s;
54
+ }
55
 
56
+ location = /code {
57
+ return 308 /code/;
58
+ }
 
59
 
60
+ location /code/ {
61
+ proxy_set_header Authorization "";
62
+ proxy_set_header X-Forwarded-Prefix /code;
63
+ proxy_pass http://127.0.0.1:${CODE_PORT}/;
64
+ proxy_http_version 1.1;
65
+ proxy_set_header Upgrade $http_upgrade;
66
+ proxy_set_header Connection $connection_upgrade;
67
+ proxy_set_header Host $host;
68
+ proxy_read_timeout 86400;
69
+ proxy_send_timeout 86400;
70
+ proxy_buffering off;
71
+ }
72
 
73
+ location ~ ^/proxy/([0-9]+)/(.*)$ {
74
+ proxy_set_header X-Forwarded-Prefix /proxy/$1;
75
+ proxy_pass http://127.0.0.1:$1/$2$is_args$args;
76
+ }
77
 
78
+ location ~ ^/proxy/([0-9]+)$ {
79
+ return 308 /proxy/$1/;
80
+ }
81
+
82
+ location ~ ^/([0-9]+)/(.*)$ {
83
+ proxy_set_header X-Forwarded-Prefix /$1;
84
+ proxy_pass http://127.0.0.1:$1/$2$is_args$args;
85
+ }
86
+
87
+ location ~ ^/([0-9]+)$ {
88
+ return 308 /$1/;
89
+ }
90
 
91
+ location / {
92
+ proxy_pass http://127.0.0.1:${OPENCLAW_PORT};
93
+ }
94
  }
 
95
  }