mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-07-01 20:42:07 +00:00
fix / 13
13 / removed getting host from env 13 / traefik vless reality/grpc labels
This commit is contained in:
parent
10d6687aea
commit
7ef6b9461e
3 changed files with 15 additions and 14 deletions
|
@ -4,7 +4,8 @@ BUILD_WITH_ANTIZAPRET="0"
|
||||||
XUI_SERVER_IP=""
|
XUI_SERVER_IP=""
|
||||||
XUI_PANEL_DOMAIN=""
|
XUI_PANEL_DOMAIN=""
|
||||||
XUI_SUB_DOMAIN=""
|
XUI_SUB_DOMAIN=""
|
||||||
XUI_VLESS_SNI=""
|
XUI_VLESS_REALITY_SNI=""
|
||||||
|
XUI_VLESS_GRPC_SNI=""
|
||||||
#XUI_SUB_PROFILE_TITLE=""
|
#XUI_SUB_PROFILE_TITLE=""
|
||||||
#XUI_SUB_SUPPORT_URL=""
|
#XUI_SUB_SUPPORT_URL=""
|
||||||
#XUI_SUB_PROFILE_WEB_PAGE_URL=""
|
#XUI_SUB_PROFILE_WEB_PAGE_URL=""
|
||||||
|
|
|
@ -24,10 +24,16 @@ services:
|
||||||
- "traefik.http.routers.3x-ui-sub.entrypoints=https"
|
- "traefik.http.routers.3x-ui-sub.entrypoints=https"
|
||||||
- "traefik.http.services.3x-ui-sub.loadbalancer.server.port=2096"
|
- "traefik.http.services.3x-ui-sub.loadbalancer.server.port=2096"
|
||||||
#
|
#
|
||||||
- "traefik.tcp.routers.vless.rule=HostSNI(`${XUI_VLESS_SNI}`)"
|
- "traefik.tcp.routers.vless-reality.rule=HostSNI(`${XUI_VLESS_REALITY_SNI}`)"
|
||||||
- "traefik.tcp.routers.vless.tls.passthrough=true"
|
- "traefik.tcp.routers.vless-reality.tls.passthrough=true"
|
||||||
- "traefik.tcp.routers.vless.service=3x-ui-inbound-443"
|
- "traefik.tcp.routers.vless-reality.service=3x-ui-inbound-443"
|
||||||
- "traefik.tcp.services.3x-ui-inbound-443.loadbalancer.server.port=443"
|
- "traefik.tcp.services.3x-ui-inbound-443.loadbalancer.server.port=443"
|
||||||
|
#
|
||||||
|
- "traefik.tcp.routers.vless-grpc.rule=HostSNI(`${XUI_VLESS_GRPC_SNI}`)"
|
||||||
|
- "traefik.tcp.routers.vless-grpc.tls.passthrough=true"
|
||||||
|
- "traefik.tcp.routers.vless-grpc.entrypoints=https"
|
||||||
|
- "traefik.tcp.routers.vless-grpc.service=3x-ui-inbound-8888"
|
||||||
|
- "traefik.tcp.services.3x-ui-inbound-8888.loadbalancer.server.port=8888"
|
||||||
volumes:
|
volumes:
|
||||||
- ./db/:/etc/x-ui/
|
- ./db/:/etc/x-ui/
|
||||||
- ./db/fail2ban.sqlite3:/var/lib/fail2ban/fail2ban.sqlite3
|
- ./db/fail2ban.sqlite3:/var/lib/fail2ban/fail2ban.sqlite3
|
||||||
|
|
|
@ -59,11 +59,8 @@ func (a *SUBController) initRouter(g *gin.RouterGroup) {
|
||||||
func (a *SUBController) subs(c *gin.Context) {
|
func (a *SUBController) subs(c *gin.Context) {
|
||||||
subId := c.Param("subid")
|
subId := c.Param("subid")
|
||||||
var host string
|
var host string
|
||||||
host = os.Getenv("XUI_SERVER_IP")
|
if h, err := getHostFromXFH(c.GetHeader("X-Forwarded-Host")); err == nil {
|
||||||
if host == "" {
|
host = h
|
||||||
if h, err := getHostFromXFH(c.GetHeader("X-Forwarded-Host")); err == nil {
|
|
||||||
host = h
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if host == "" {
|
if host == "" {
|
||||||
host = c.GetHeader("X-Real-IP")
|
host = c.GetHeader("X-Real-IP")
|
||||||
|
@ -122,11 +119,8 @@ func (a *SUBController) subs(c *gin.Context) {
|
||||||
func (a *SUBController) subJsons(c *gin.Context) {
|
func (a *SUBController) subJsons(c *gin.Context) {
|
||||||
subId := c.Param("subid")
|
subId := c.Param("subid")
|
||||||
var host string
|
var host string
|
||||||
host = os.Getenv("XUI_SERVER_IP")
|
if h, err := getHostFromXFH(c.GetHeader("X-Forwarded-Host")); err == nil {
|
||||||
if host == "" {
|
host = h
|
||||||
if h, err := getHostFromXFH(c.GetHeader("X-Forwarded-Host")); err == nil {
|
|
||||||
host = h
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if host == "" {
|
if host == "" {
|
||||||
host = c.GetHeader("X-Real-IP")
|
host = c.GetHeader("X-Real-IP")
|
||||||
|
|
Loading…
Reference in a new issue