feat: 修改nginx为host模式

This commit is contained in:
zhengkunwang223 2022-11-20 21:04:39 +08:00
parent ebd830887c
commit 37faf7a7fb
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