Add single domain gateway routing

This commit is contained in:
2026-07-09 16:03:29 +08:00
parent 664d1acbce
commit 7587da6d18
14 changed files with 133 additions and 29 deletions

View File

@@ -23,14 +23,14 @@ serverPort = ${FRP_SERVER_PORT:-7000}
auth.token = "${FRP_AUTH_TOKEN}"
[[proxies]]
name = "${FRP_PROXY_NAME:-qa-backend}"
name = "${FRP_PROXY_NAME:-qa-web}"
type = "http"
localIP = "${FRP_LOCAL_IP:-backend}"
localPort = ${FRP_LOCAL_PORT:-8100}
localIP = "${FRP_LOCAL_IP:-gateway}"
localPort = ${FRP_LOCAL_PORT:-80}
customDomains = [${_domains}]
EOF
echo "=== frpc config generated ==="
cat /etc/frp/frpc.toml
exec frpc -c /etc/frp/frpc.toml
exec frpc -c /etc/frp/frpc.toml

View File

@@ -0,0 +1,54 @@
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name _;
client_max_body_size 20m;
location = /login {
return 302 $scheme://$http_host/login/;
}
location ^~ /api/ {
proxy_pass http://backend:8100;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_buffering off;
proxy_read_timeout 3600s;
}
location ^~ /login/ {
proxy_pass http://admin-web:5174;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_buffering off;
proxy_read_timeout 3600s;
}
location / {
proxy_pass http://user-client:5173;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_buffering off;
proxy_read_timeout 3600s;
}
}