Files
im_webapp/docker/nginx.conf
T
Your Name 111d9040a7 修复健康检查失败: nginx补上IPv6监听
首次部署时健康检查一直失败——容器内nginx只listen了IPv4(0.0.0.0:80),
但/etc/hosts里localhost解析到::1在前,wget http://localhost/因而连不上。
补上 listen [::]:80 双栈监听解决。部署脚本那边也同步改成直连127.0.0.1,
避免再依赖localhost的解析顺序。
2026-08-11 12:52:06 +08:00

22 lines
490 B
Nginx Configuration File

server {
listen 80;
listen [::]:80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Tinode webapp uses hash-based client-side routing, so any unknown path
# can safely fall back to index.html.
location / {
try_files $uri $uri/ /index.html;
}
location /umd/ {
add_header Cache-Control "public, max-age=31536000, immutable";
}
location /img/ {
add_header Cache-Control "public, max-age=86400";
}
}