38

Trojan+V2ray(VLESS+Xtls)+WordPress,通过Nginx的SNI实现共用443端口(用户投稿)

 3 years ago
source link: https://www.v2rayssr.com/trojanv2rayvlessxtlswordpress.html?_ga=2.172143523.1053965402.1627696589-394768438.1627696589
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

前言

v2ray的vless出现的有段时间了,其中的tcp+xtls方案还是蛮有趣的,这次通过nginx的sni来实现trojan、v2ray与nginx共用443端口的方案,话不多说开始了。 准备工作

1、VPS一台,CentOS 7的操作系统(其他系统也是可以的),本次使用的是vultr的vps

2、域名一个,创建三个子域名,本次trojan使用tj.popyh.ml , v2ray使用v2.popyh.ml , WordPress使用popyh.ml

3、还是耐心吧,稍微有点Linux基础 一点点的lnmp配置

1、配置 MySQL

wget wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm rpm -Uvh mysql80-community-release-el7-3.noarch.rpm vi /etc/yum.repos.d/mysql-community.repo #要选择什么版本就令它的enable=1,可以通过Finalshell等直接打开/etc/yum.repos.d/mysql-community.repo修改

#安装 MySQL yum install mysql-community-server -y systemctl start mysqld.service systemctl status mysqld.service #保护 MySQL mysql_secure_installation #设置root密码,后全Y #连接到 MySQL 服务器 mysql -u root -p #创建数据库 CREATE DATABASE wp;

2、配置nginx

yum -y install epel-release yum -y install python-certbot-nginx nginx #删除nginx默认配置 rm -rf /etc/nginx/sites-enabled/default

3、配置php

yum -y install gcc gcc-c++ yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -y yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y yum -y install yum-utils yum-config-manager --enable remi-php73 yum -y install php php-mcrypt php-devel php-cli php-gd php-pear php-curl php-fpm php-mysql php-ldap php-zip php-fileinfo #启动与开机启动 systemctl start php-fpm systemctl enable php-fpm.service

WordPress的一点配置

yum install wget git curl -y mkdir -p /mnt/c/www && cd /mnt/c/www wget http://wordpress.org/latest.tar.gz tar -xzvf latest.tar.gz mv wordpress/* ./ #配置v2ray和trojan的网页 mkdir -p /mnt/d/www && cd /mnt/d/www git clone https://github.com/xiongbao/we.dog.git mv we.dog/* ./

certbot签订证书

#记得改域名 certbot certonly --standalone -d popyh.ml --agree-tos --email [email protected] certbot certonly --standalone -d v2.popyh.ml --agree-tos --email [email protected] certbot certonly --standalone -d tj.popyh.ml --agree-tos --email [email protected]

配置nginx

vim /etc/nginx/nginx.conf #改域名 stream { map $ssl_preread_server_name $backend_name { tj.popyh.ml trojan; v2.popyh.ml v2ray; popyh.ml web; default web; } upstream v2ray { server 127.0.0.1:10240; } upstream trojan { server 127.0.0.1:10241; } upstream web { server 127.0.0.1:10242; } server { listen 443 reuseport; listen [::]:443 reuseport; proxy_pass $backend_name; ssl_preread on; } }

写入一个nginx站点配置文件 #下面全部复制,可以新建个记事本复制进去改域名,然后复制进终端,回车 cat > /etc/nginx/conf.d/v2ray.conf /usr/local/etc/v2ray/config.json /usr/local/etc/trojan/config.json


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK