修复健康检查失败: nginx补上IPv6监听
首次部署时健康检查一直失败——容器内nginx只listen了IPv4(0.0.0.0:80), 但/etc/hosts里localhost解析到::1在前,wget http://localhost/因而连不上。 补上 listen [::]:80 双栈监听解决。部署脚本那边也同步改成直连127.0.0.1, 避免再依赖localhost的解析顺序。
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
Reference in New Issue
Block a user