You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

同一容器部署Alertmanager与Unsee及Nginx反向代理故障排查

Troubleshooting ERR_INVALID_RESPONSE for Unsee Behind Nginx

Hey there! Let’s figure out why your /unsee endpoint is throwing that ERR_INVALID_RESPONSE error—especially since you confirmed Unsee works perfectly when curling http://127.0.0.1:8080. The issue almost certainly lies in how Nginx is proxying requests to Unsee, so let’s break this down step by step.

Common Configuration Fixes to Try

1. Fix Proxy Path Handling

If your Nginx location /unsee block doesn’t handle URI paths correctly, Unsee might get malformed requests it can’t respond to. For example, omitting the trailing slash in proxy_pass makes Nginx pass the /unsee prefix to Unsee, which doesn’t expect it (since Unsee serves content from its own root /).

Use this corrected location block:

location /unsee/ {
    # Forward requests to Unsee's local port
    proxy_pass http://127.0.0.1:8080/;
    
    # Add critical headers to help Unsee process the request properly
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
}

Notice the trailing slash in both location /unsee/ and proxy_pass—this tells Nginx to strip the /unsee prefix when forwarding requests to Unsee, matching how Unsee expects to receive traffic.

2. Check Nginx Error Logs for Clues

Nginx’s error logs will give you specific details about what’s failing. Run this command to view the latest errors in real time:

tail -f /var/log/nginx/error.log

Look for messages like "connection refused" (if Unsee isn’t listening on 127.0.0.1:8080) or "invalid response from upstream" (if Unsee rejects the request format).

3. Verify Unsee’s Binding Address

Double-check that Unsee is configured to listen on 0.0.0.0:8080 or 127.0.0.1:8080. If it’s only bound to a specific container IP that Nginx can’t reach, that would cause a failure. Your curl test to 127.0.0.1:8080 suggests this is probably fine, but it’s worth confirming in Unsee’s config file.

Test Your Changes

After updating your Nginx configuration:

  1. Validate the config to catch syntax errors:
    nginx -t
    
  2. Reload Nginx to apply the changes:
    nginx -s reload
    
  3. Try accessing /unsee again in your browser—this should resolve the ERR_INVALID_RESPONSE error.

内容的提问来源于stack exchange,提问作者Simply Seth

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 10:24:52