Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add New Json Socks5-WS-Web-TLS-Nginx #60

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions Socks5-WS-Web-TLS-Nginx/config_client.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"log": {
"loglevel": "warning"
},
"inbounds": [
{
"port": 1080,
"protocol": "socks",
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
},
"settings": {
"auth": "noauth",
"udp": true
}
}
],
"outbounds": [
{
"protocol": "socks",
"settings": {
"servers": [
{
"address": "你的域名",
"port": 443
}
]
},
"streamSettings": {
"network": "ws",
"security": "tls",
"wsSettings": {
"path": "/comebey"
}
}
}
]
}
36 changes: 36 additions & 0 deletions Socks5-WS-Web-TLS-Nginx/config_server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"log": {
"loglevel": "warning"
},
"inbounds": [
{
"port": "1080",
"listen": "127.0.0.1",
"protocol": "socks",
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
},
"settings": {
"auth": "noauth",
"udp": true,
"userLevel": 10
},
"streamSettings": {
"network": "ws",
"wsSettings": {
"path": "/comebey"
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
}
]
}
61 changes: 61 additions & 0 deletions Socks5-WS-Web-TLS-Nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

include /usr/share/nginx/modules/*.conf;


events {
worker_connections 1024;
}

http {
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;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;

include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;

server {
listen 80;
server_name 域名;
rewrite ^/(.*) https://域名$1 permanent;
}

server #关键代码
{
# SSL configuration
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
ssl_certificate /路径/*.pem; #你的ssl证书*.crt 或者 *.pem
ssl_certificate_key /路径/*.key; #你的ssl key
ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+ECDSA+AES128:EECDH+aRSA+AES128:RSA+AES128:EECDH+ECDSA+AES256:EECDH+aRSA+AES256:RSA+AES256:EECDH+ECDSA+3DES:EECDH+aRSA+3DES:RSA+3DES:!MD5; #套件RSA和ecc不一样在下面我会分别给出
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; #套件
root /usr/share/nginx/html; #网页路径,这里也可以放你们自己的html网站替换下就可以了
server_name 域名; #你的服务器域名

location /comebey {
proxy_redirect off;
proxy_pass http://127.0.0.1:1080; #此IP地址和端口需要和socks服务器端配置保持一致,
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
}

}


}