Skip to content

Commit

Permalink
update config
Browse files Browse the repository at this point in the history
  • Loading branch information
KtKID committed Dec 10, 2022
1 parent ebe7f2e commit 4c2aeda
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 19 deletions.
21 changes: 10 additions & 11 deletions build_run.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
#!/usr/bin/env bash

# -e V2RAY_TOKEN="0000000-0000-0000-000-000000" \
docker build -t docker-nginx-v2ray .

cert_dir=$(pwd)/cert
SITE_DOMAIN="domain"
echo "cert_dir"
echo $cert_dir
mkdir -p ${cert_dir}
SITE_DOMAIN="domain" #你的域名
SSL_PORT=13431
V2RAY_PORT=54321
docker container run \
-d \
--name nginx-v2ray \
-p 80:80 \
-p 443:443 \
-v "/etc/letsencrypt/archive/$(SITE_DOMAIN)":/data/cert/$(SITE_DOMAIN) \
-e SITE_DOMAIN="$(SITE_DOMAIN)" \
-p ${V2RAY_PORT}:${V2RAY_PORT} \
-p ${SSL_PORT}:${SSL_PORT} \
-v "/etc/letsencrypt/archive/${SITE_DOMAIN}":/data/cert/${SITE_DOMAIN} \
-e SITE_DOMAIN="${SITE_DOMAIN}" \
-e V2RAY_TOKEN="0000000-0000-0000-000-000000" \
-e V2RAY_PORT=12345
-e SSL_PORT=443
-e V2RAY_PORT=${V2RAY_PORT} \
-e SSL_PORT=${SSL_PORT} \
-e V2RAY_WS_PATH=/ray \
docker-nginx-v2ray
9 changes: 2 additions & 7 deletions conf/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,10 @@
}
}
server {
listen 8070 default_server;
listen 80 default_server;
location / {
root /data/www/html/;
index index.html;
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_pass http://127.0.0.1:8090; # 需要代理的地址:端口
# proxy_pass http://127.0.0.1:8090; # 需要代理的地址:端口
}
}
17 changes: 17 additions & 0 deletions html/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<title>Welcome to the world!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>一枝红杏出墙来!</h1>

</body>
</html>
3 changes: 2 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ start_nginx() {
-e "s:\${V2RAY_PORT}:${V2RAY_PORT}:" \
-e "s:\${V2RAY_WS_PATH}:${V2RAY_WS_PATH}:" \
-e "s:\${SITE_DOMAIN}:${SITE_DOMAIN}:" \
-e "s:\${SSL_PORT}:${SSL_PORT}:" \
-e "s:\${CERTIFICATE_FILE}:${CERTIFICATE_FILE}:" \
-e "s:\${CERTIFICATE_KEY_FILE}:${CERTIFICATE_KEY_FILE}:" \
-e "s:\${DHPARAM_FILE}:${DHPARAM_FILE}:" \
/conf/nginx/nginx.conf >${NGINX_CONF}

echo "starting nginx at port 80(http)&443(https)"
echo "starting nginx at port ${SSL_PORT}(https)"
mkdir -p /run/nginx
nginx && echo "nginx started"
}
Expand Down

0 comments on commit 4c2aeda

Please sign in to comment.