This commit is contained in:
Robert Zhou
2020-05-08 23:18:53 +01:00
parent 2456e5a785
commit 62a03a5d1d
12 changed files with 225 additions and 62 deletions
+63 -21
View File
@@ -1,34 +1,76 @@
# v2ray-ws-tls-all-in-one
# v2ray websocks tls + web all-in-one Docker
<a href="https://github.com/alphacodinghub/v2ray-docker/"><img src="https://img.shields.io/badge/Docker-v2ray-4BC51D.svg?style=flat"></a>
![](https://img.shields.io/badge/language-Web-orange.svg)
![](https://img.shields.io/badge/platform-Docker-lightgrey.svg)[![](https://img.shields.io/badge/Traefik-v2.x-blue.svg)](https://containo.us/traefik/)
![](https://img.shields.io/badge/license-MIT-000000.svg)
**A v2ray docker image work with nginx**
## [中文指引请点击此处](https://github.com/alphacodinghub/v2ray/blob/master/README_cn.md)
- v2ray work with websocket
- v2ray request proxy_pass by nginx
- custom v2ray settings
- add environment variables to edit optional setting
- CLIENT_ID (default ad806487-2d26-4636-98b6-ab85cc8521f7)
- CLIENT_ALTERID (default 64)
- CLIENT_WSPATH (default /ws)
- VER (default 4.23.1)
- don't need custom domain and ssl certificate
- only cost 1 pods
## V2Ray quick deployment using Traefik
**USE: deploy this image and add default secure route with port 8080 in arukas**
- The Docker image is based on the latest official release and integrated with Nginx and a basic website.
- Deployment using Traefik, easy operation.
- Traefik automatically manages ssl certificates.
- A basic static website is integrated with the image. It will redirect to baidu.com by default however you can replace it with your own real website.
- V2Ray parameters can be easily customized using the `.env` file. You don't need to change the `docker-compose.yml` file.
- Main parameters you can customize indlude domain name, UUID, v2ray listening port, and the camouflaged path.
- path to v2ray: https://your.domain/fuckgfw_letscrossgfw
- path to websites: /usr/share/nginx/html/
## V2Ray server setup and configuration
实例教程参考
### 1. VPS
- [V2Ray+WebSocket+TLS+Nginx 配置与使用教程](https://doubibackup.com/v2ray-ws-tls-nginx.html)
- https://toutyrater.github.io/advanced/wss_and_web.html
- https://bawodu.com/openshift-v2ray/
- To buy a VPS and install Docker engine and git tool.
- To buy a domain, e.g. example.com.
- Choose an app name for your V2Ray server, e.g. `myapp`. Your camouflaged website url will then be `https://myapp.example.com`.
- Configure the DNS to point the domain `myapp.example.com` to the IP address of your VPS.
### 2. Clone this project to your VPS
```
- mkdir /app
- cd /app
- git clone https://github.com/alphacodinghub/v2ray-nginx-docker.git
- cd v2ray-nginx-docker
```
### 3. Configure VPS
To edit `.env` file and set necessary parameters. These three parameters must be set to your own values: APP_NAME (as chosen in Step 1), APP_DOMAIN, ACME_EMAIL (your email address for Let's Encrypt to apply for and renew ssl certificates). All other parameters can use the default values as provided. The final `.env` file should look like this (you should set your own values):
```
APP_NAME=myapp
APP_DOMAIN=example.com
ACME_EMAIL=myemail@example.com
LISTENING_PORT=3033
CLIENT_ID=2e5762cc-20d2-42b1-b0ad-cbe55dc5fa35
CLIENT_ALTERID=64
CLIENT_WSPATH=/allproducts
```
In the above settings, `CLIENT_WSPATH` is the so-called camouflaged path which should be set to the same value at the VPS server and user clients.
### 4. Website settings
By default, the caouflaged website will be redirected to baidu.com. You can copy your real website content to `./conf/html` folder to replace original files.
### 5. Start V2Ray server
After above settings, you can run the following command in folder `/app/v2ray-nginx-docker` to start the V2Ray server: `docker-compose up -d`. The `-d` option is to tell the programme to run in the background.
Run this command to check the running containers: `docker ps`.
To access to Traefik Dashboardhttps://traefik.example.com
To visit the camouflaged websitehttps://myapp.example.com
## Client configuration
Download the Windows client V2RayN, run it and click the menu: server - add [VMess] server. Please set the values according to the below figure:
![v2ray配置](https://github.com/alphacodinghub/v2ray/blob/master/images/v2rayn.png)
> **References**
- [Official Project V Website](https://www.v2ray.com/)
- [新白话文教程-V2Ray 配置指南](https://guide.v2fly.org/)
- <a href="https://github.com/v2fly/docker">Official Dockerfile</a>
- https://github.com/v2ray/ext
- https://toutyrater.github.io/app/docker-deploy-v2ray.html
- <a href="https://vimcaw.github.io/blog/2018/03/12/Shadowsocks(R)%E8%AE%BE%E7%BD%AE%EF%BC%9A%E7%B3%BB%E7%BB%9F%E4%BB%A3%E7%90%86%E6%A8%A1%E5%BC%8F%E3%80%81PAC%E3%80%81%E4%BB%A3%E7%90%86%E8%A7%84%E5%88%99/">SSR proxy settings - a great explaination</a>