1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-03-13 17:24:44 +08:00

feat: 修改nginx为host模式

This commit is contained in:
zhengkunwang223 2022-11-20 21:04:39 +08:00 committed by zhengkunwang223
parent fb90fae87f
commit 6f7584b72d
2 changed files with 3 additions and 6 deletions

View File

@ -3,8 +3,7 @@ services:
container_name: ${CONTAINER_NAME}
image: nginx:1.23.1
restart: always
networks:
- 1panel
network_mode: host
ports:
- ${PANEL_APP_PORT_HTTP}:80
- ${PANEL_APP_PORT_HTTPS}:443
@ -14,6 +13,4 @@ services:
- ./conf/conf.d:/etc/nginx/conf.d/
- ./ssl:/etc/nginx/ssl
networks:
1panel:
external: true

View File

@ -74,7 +74,7 @@ func configDefaultNginx(website *model.WebSite, domains []model.WebSiteDomain) e
server.UpdateListen(strconv.Itoa(domain.Port), false)
}
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})
config.FilePath = configPath