V2ray+ws+Nginx+Cloudflare¶
AWS-Marketplace¶
Usage Instructions¶
Note
Before you start to access the system, please ensure the Status Checks of the instance in the AWS Console turns to 2/2 checks passed, or the initialization process might be interrupted and the software configuration fails. It takes about 5-10 mins.
Note
Please replace the instance ID with the actual instance ID of your running EC2 instance, and the Public IP your actual public DNS address.
Advance Setting¶
- set the DNS with Cloudflare 
 
 
- set up your Domain Name in Cloudflare 
 
- set up your SSL in Cloudflare, you must save the file in your EC2: - PRIVATE KEY->- privkey.pem,- CERTIFICATE->- fullchain.pem
 
- set the SSL mode 
 
- SSH to your EC2, then you need to install Nginx 
Type the command:
sudo apt-get install nginxthen upload the
privkey.pemandfullchain.pemto the/etc/nginx/ssl/and then set up the nginx:
vi /etc/nginx/conf.d/v2ray.conf server { listen 443 ssl; server_name example.com; ssl_certificate /etc/nginx/ssl/fullchain.pem; ssl_certificate_key /etc/nginx/ssl/privkey.pem; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; error_page 497 https://$host$request_uri; location /ray { proxy_pass http://127.0.0.1:6868; proxy_redirect off; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; } }You can add more more
locationthat was yourpathin v2ray. In this exmaple thepathis/ray, thenportis6868Finally you must restart the nginx. Type the command:sudo /etc/init.d/nginx restart
- set up the v2ray 
 
- set up the v2ray client, the - addresswas your Domain Name
