mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-11-09 11:10:34 +08:00
feat: 修改nginx为host模式
This commit is contained in:
parent
fb90fae87f
commit
6f7584b72d
2 changed files with 3 additions and 6 deletions
|
|
@ -3,8 +3,7 @@ services:
|
||||||
container_name: ${CONTAINER_NAME}
|
container_name: ${CONTAINER_NAME}
|
||||||
image: nginx:1.23.1
|
image: nginx:1.23.1
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
network_mode: host
|
||||||
- 1panel
|
|
||||||
ports:
|
ports:
|
||||||
- ${PANEL_APP_PORT_HTTP}:80
|
- ${PANEL_APP_PORT_HTTP}:80
|
||||||
- ${PANEL_APP_PORT_HTTPS}:443
|
- ${PANEL_APP_PORT_HTTPS}:443
|
||||||
|
|
@ -14,6 +13,4 @@ services:
|
||||||
- ./conf/conf.d:/etc/nginx/conf.d/
|
- ./conf/conf.d:/etc/nginx/conf.d/
|
||||||
- ./ssl:/etc/nginx/ssl
|
- ./ssl:/etc/nginx/ssl
|
||||||
|
|
||||||
networks:
|
|
||||||
1panel:
|
|
||||||
external: true
|
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ func configDefaultNginx(website *model.WebSite, domains []model.WebSiteDomain) e
|
||||||
server.UpdateListen(strconv.Itoa(domain.Port), false)
|
server.UpdateListen(strconv.Itoa(domain.Port), false)
|
||||||
}
|
}
|
||||||
server.UpdateServerName(serverNames)
|
server.UpdateServerName(serverNames)
|
||||||
proxy := fmt.Sprintf("http://%s:%d", appInstall.ServiceName, appInstall.HttpPort)
|
proxy := fmt.Sprintf("http://127.0.0.1:%d", appInstall.HttpPort)
|
||||||
server.UpdateRootProxy([]string{proxy})
|
server.UpdateRootProxy([]string{proxy})
|
||||||
|
|
||||||
config.FilePath = configPath
|
config.FilePath = configPath
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue