server { listen 80 default_server; listen [::]:80 default_server; listen 443 http2 ssl; ssl_certificate /etc/chitaner.com.pem; ssl_certificate_key /etc/chitaner.com.key;
server_name ~^(?<subdomain>.+).chitaner.com$;
server_name chitaner.com;
location / {
if ($subdomain = "keylic") {
proxy_pass http://127.0.0.1:8060;
}
if ($subdomain = "picsee") {
root /var/www/picsee;
}
if ($subdomain = "blog") {
root /var/www/blog;
}
if ($subdomain = "enpicsee") {
root /var/www/enpicsee;
}
if ($subdomain = "longshot") {
root /var/www/longshot;
}
if ($subdomain = "enlongshot") {
root /var/www/enlongshot;
}
if ($subdomain = "picview") {
root /var/www/picview;
}
if ($subdomain = "enpicview") {
root /var/www/enpicview;
}
root /var/www/chitaner;
index index.html;
}
location /api/ {
proxy_pass http://127.0.0.1:3000;
}
location /ray { # 与 V2Ray 配置中的 path 保持一致
proxy_redirect off;
proxy_pass http://127.0.0.1:9000;#假设WebSocket监听在环回地址的10000端口上
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
# Show realip in v2ray access.log
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server { listen 80 default_server; listen [::]:80 default_server; listen 443 http2 ssl; ssl_certificate /etc/chitaner.com.pem; ssl_certificate_key /etc/chitaner.com.key;
server_name ~^(?<subdomain>.+).chitaner.com$;
server_name chitaner.com;
location / {
if ($subdomain = "picsee") {
root /var/www/picsee;
}
if ($subdomain = "blog") {
root /var/www/blog;
}
if ($subdomain = "enpicsee") {
root /var/www/enpicsee;
}
if ($subdomain = "longshot") {
root /var/www/longshot;
}
if ($subdomain = "enlongshot") {
root /var/www/enlongshot;
}
root /var/www/chitaner;
index index.html;
}
location /api/ {
proxy_pass http://127.0.0.1:3000;
}
location /ray { # 与 V2Ray 配置中的 path 保持一致
proxy_redirect off;
proxy_pass http://127.0.0.1:9000;#假设WebSocket监听在环回地址的10000端口上
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
# Show realip in v2ray access.log
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server { listen 80 default_server; listen [::]:80 default_server; listen 443 http2 ssl; ssl_certificate /etc/chitaner.com.pem; ssl_certificate_key /etc/chitaner.com.key; root /var/www/$subdomain;
server_name ~^(?<subdomain>.+)\.chitaner\.com$;
location /api/ {
proxy_pass http://127.0.0.1:3000;
}
location /ray { # 与 V2Ray 配置中的 path 保持一致
proxy_redirect off;
proxy_pass http://127.0.0.1:9000;#假设WebSocket监听在环回地址的10000端口上
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
# Show realip in v2ray access.log
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
}
nginx -s reload
{
"log": {
"access": "/Users/kzhiquan/.V2rayU/v2ray-core.log",
"loglevel": "info",
"error": "/Users/kzhiquan/.V2rayU/v2ray-core.log"
},
"inbounds": [
{
"listen": "127.0.0.1",
"settings": {
"auth": "noauth",
"udp": false
},
"protocol": "socks",
"port": "1081"
},
{
"listen": "127.0.0.1",
"port": "8001",
"protocol": "http",
"settings": {
"timeout": 360
}
}
],
"outbounds": [
{
"protocol": "vmess",
"settings": {
"vnext": [
{
"port": 443,
"users": [
{
"level": 1,
"security": "auto",
"alterId": 0,
"id": "ffbe15b7-12f2-442b-a024-7d0383aee5fe"
}
],
"address": "chitaner.com"
}
]
},
"mux": {
"enabled": false,
"concurrency": 8
},
"tag": "proxy",
"streamSettings": {
"security": "tls",
"network": "ws",
"wsSettings": {
"path": "/ray",
"headers": {
"host": "chitaner.com"
}
},
"tlsSettings": {
"serverName": "",
"allowInsecure": true,
"fingerprint": "chrome"
}
}
},
{
"protocol": "freedom",
"settings": {
"userLevel": 0,
"domainStrategy": "UseIP"
},
"tag": "direct"
},
{
"settings": {
"response": {
"type": "none"
}
},
"protocol": "blackhole",
"tag": "block"
}
],
"dns": {},
"routing": {
"balancers": [],
"rules": [],
"domainStrategy": "AsIs"
}
}
{
"inbounds": [{
"port": 9000,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "ffbe15b7-12f2-442b-a024-7d0383aee5fe",
"level": 1,
"alterId": 0
}
]
},
"streamSettings":{
"network":"ws",
"wsSettings":{
"path":"/ray"
}
}
}],
"outbounds": [{
"protocol": "freedom",
"settings": {}
},{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}],
"routing": {
"rules": [
{
"type": "field",
"ip": ["geoip:private"],
"outboundTag": "blocked"
}
]
}
}
#############################################################################