forked from hiifeng/V2ray-for-Doprax
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
188 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM nginx:latest | ||
MAINTAINER ifeng <https://t.me/HiaiFeng> | ||
EXPOSE 80 | ||
USER root | ||
|
||
RUN apt-get update && apt-get install -y supervisor wget unzip | ||
|
||
#定义 UUID 及 伪装路径,请自行修改.(注意:伪装路径前无需加/符号,程序已自行添加.) | ||
ENV UUID de04add9-5c68-8bab-950c-08cd5320df18 | ||
ENV VMESS_WSPATH vmess | ||
ENV VLESS_WSPATH vless | ||
|
||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf | ||
COPY nginx.conf /etc/nginx/nginx.conf | ||
|
||
RUN mkdir /etc/v2ray /usr/local/v2ray | ||
COPY config.json /etc/v2ray/ | ||
COPY entrypoint.sh /usr/local/v2ray/ | ||
RUN chmod a+x /usr/local/v2ray/entrypoint.sh | ||
|
||
RUN wget -q -O /tmp/v2ray-linux-64.zip https://github.com/v2fly/v2ray-core/releases/download/v4.45.0/v2ray-linux-64.zip && \ | ||
unzip -d /usr/local/v2ray /tmp/v2ray-linux-64.zip | ||
|
||
ENTRYPOINT [ "/usr/local/v2ray/entrypoint.sh" ] | ||
CMD ["/usr/bin/supervisord"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"log": { | ||
"access": "/dev/null", | ||
"error": "/dev/null", | ||
"loglevel": "warning" | ||
}, | ||
"inbounds": [{ | ||
"port": 10000, | ||
"listen": "127.0.0.1", | ||
"protocol": "vmess", | ||
"settings": { | ||
"clients": [{ | ||
"id": "UUID", | ||
"alterId": 0 | ||
}] | ||
}, | ||
"streamSettings": { | ||
"network": "ws", | ||
"wsSettings": { | ||
"path": "/VMESS_WSPATH" | ||
} | ||
} | ||
}, | ||
{ | ||
"port": 20000, | ||
"listen": "127.0.0.1", | ||
"protocol": "vless", | ||
"settings": { | ||
"clients": [{ | ||
"id": "UUID" | ||
}], | ||
"decryption": "none" | ||
}, | ||
"streamSettings": { | ||
"network": "ws", | ||
"wsSettings": { | ||
"path": "/VLESS_WSPATH" | ||
} | ||
} | ||
} | ||
], | ||
"outbounds": [{ | ||
"protocol": "freedom", | ||
"settings": {} | ||
}], | ||
"dns": { | ||
"server": [ | ||
"8.8.8.8", | ||
"8.8.4.4", | ||
"localhost" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
# Create By ifeng | ||
# Web Site:https://www.hicairo.com | ||
# Telegram:https://t.me/HiaiFeng | ||
|
||
sed -i "s/UUID/$UUID/g" /etc/v2ray/config.json | ||
sed -i "s/VMESS_WSPATH/$VMESS_WSPATH/g" /etc/v2ray/config.json | ||
sed -i "s/VLESS_WSPATH/$VLESS_WSPATH/g" /etc/v2ray/config.json | ||
sed -i "s/VMESS_WSPATH/$VMESS_WSPATH/g" /etc/nginx/nginx.conf | ||
sed -i "s/VLESS_WSPATH/$VLESS_WSPATH/g" /etc/nginx/nginx.conf | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
|
||
user nginx; | ||
worker_processes auto; | ||
|
||
error_log /var/log/nginx/error.log notice; | ||
pid /var/run/nginx.pid; | ||
|
||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /var/log/nginx/access.log main; | ||
|
||
sendfile on; | ||
#tcp_nopush on; | ||
|
||
keepalive_timeout 65; | ||
|
||
#gzip on; | ||
|
||
#include /etc/nginx/conf.d/*.conf; | ||
|
||
server { | ||
listen 80 default_server; | ||
listen [::]:80 default_server; | ||
|
||
server_name _; | ||
charset utf-8; | ||
root html; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
} | ||
|
||
location /VMESS_WSPATH { | ||
proxy_redirect off; | ||
proxy_pass http://127.0.0.1:10000; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection upgrade; | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
|
||
location /VLESS_WSPATH { | ||
proxy_redirect off; | ||
proxy_pass http://127.0.0.1:20000; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection upgrade; | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Create By ifeng | ||
# Web Site:https://www.hicairo.com | ||
# Telegram:https://t.me/HiaiFeng | ||
|
||
[supervisord] | ||
nodaemon=true | ||
logfile=/var/log/supervisord.log | ||
pidfile=/run/supervisord.pid | ||
|
||
[program:v2ray] | ||
command=/usr/local/v2ray/v2ray -config=/etc/v2ray/config.json | ||
stdout_logfile=/dev/stdout | ||
stdout_logfile_maxbytes=0 | ||
redirect_stderr=true | ||
autorestart=false | ||
startretries=0 | ||
|
||
[program:nginx] | ||
command=nginx -g 'daemon off;' | ||
stdout_logfile=/dev/stdout | ||
stdout_logfile_maxbytes=0 | ||
redirect_stderr=true | ||
autorestart=false | ||
startretries=0 | ||
|
||
# The below configure can be applied when Docker orchestrator like Docker Swarm or K8S is used. | ||
# By default, supervisor will attempt to restart a failed process. | ||
# Refer to http://supervisord.org/configuration.html for more info. | ||
#[eventlistener:processes] | ||
#command=stop-supervisor.sh | ||
#events=PROCESS_STATE_STOPPED, PROCESS_STATE_EXITED, PROCESS_STATE_FATAL |