wky commited on
Commit
f7e77d5
·
verified ·
1 Parent(s): 5e52e5a

Create entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +39 -0
entrypoint.sh ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ UUID="b831381d-6324-4d53-ad4f-8cda48b30811"
3
+ cat << EOF > /usr/share/nginx/html/config.json
4
+ {
5
+ "inbounds": [{
6
+ "port": 12345,
7
+ "protocol": "vless",
8
+ "settings": {
9
+ "clients": [{"id": "$UUID"}],
10
+ "decryption": "none"
11
+ },
12
+ "streamSettings": {
13
+ "network": "ws",
14
+ "wsSettings": {"path": "/vless"}
15
+ }
16
+ }],
17
+ "outbounds": [{"protocol": "freedom"}]
18
+ }
19
+ EOF
20
+ cat << EOF > /etc/nginx/conf.d/default.conf
21
+ server {
22
+ listen 7860;
23
+ server_name localhost;
24
+ location / {
25
+ root /usr/share/nginx/html;
26
+ index index.html;
27
+ }
28
+ location /vless {
29
+ proxy_redirect off;
30
+ proxy_pass http://127.0.0.1:12345;
31
+ proxy_http_version 1.1;
32
+ proxy_set_header Upgrade \$http_upgrade;
33
+ proxy_set_header Connection "upgrade";
34
+ proxy_set_header Host \$http_host;
35
+ }
36
+ }
37
+ EOF
38
+ /usr/share/nginx/html/xray -config /usr/share/nginx/html/config.json &
39
+ nginx -g "daemon off;"