ManiAz09 commited on
Commit
e92ad98
·
verified ·
1 Parent(s): 8a9f846

Create nginx.conf

Browse files
Files changed (1) hide show
  1. nginx.conf +46 -0
nginx.conf ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ error_log /tmp/error.log warn;
2
+ pid /tmp/nginx.pid;
3
+
4
+ events {
5
+ worker_connections 1024;
6
+ }
7
+
8
+ http {
9
+ access_log off;
10
+ client_body_temp_path /tmp/client_temp;
11
+ proxy_temp_path /tmp/proxy_temp;
12
+ fastcgi_temp_path /tmp/fastcgi_temp;
13
+ uwsgi_temp_path /tmp/uwsgi_temp;
14
+ scgi_temp_path /tmp/scgi_temp;
15
+
16
+ server {
17
+ listen 7860;
18
+
19
+ # 1. Route for WebSocket Proxy Traffic
20
+ # Inside the 3x-ui web panel, you MUST use Path: /vlessws and Port: 10000
21
+ location /vlessws {
22
+ if ($http_upgrade != "websocket") {
23
+ return 404;
24
+ }
25
+ proxy_redirect off;
26
+ proxy_pass http://127.0.0.1:10000;
27
+ proxy_http_version 1.1;
28
+ proxy_set_header Upgrade $http_upgrade;
29
+ proxy_set_header Connection "upgrade";
30
+ proxy_set_header Host $host;
31
+ proxy_set_header X-Real-IP $remote_addr;
32
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
33
+ }
34
+
35
+ # 2. Route everything else to the 3x-ui Web Panel (Default port 2053)
36
+ location / {
37
+ proxy_pass http://127.0.0.1:2053;
38
+ proxy_http_version 1.1;
39
+ proxy_set_header Upgrade $http_upgrade;
40
+ proxy_set_header Connection "upgrade";
41
+ proxy_set_header Host $host;
42
+ proxy_set_header X-Real-IP $remote_addr;
43
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
44
+ }
45
+ }
46
+ }