supervisord web界面不允许外部连接

时间:2015-05-29 10:38:43

标签: nginx supervisord

这是我的supervisord web配置,没有密码

[inet_http_server]  
port=127.0.0.1:9001
;username=user         
;password=1234

这是我的nginx配置

location /supervisor/ {
    proxy_pass http://127.0.0.1:9001;
    proxy_set_header X-Forwarded-Host $server_name;
    proxy_set_header X-Real-IP $remote_addr;
    add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
    }

如果我直接从我的服务器访问127.0.0.1:9001,我会得到我需要的信息:

root@gosthost:~# curl 127.0.0.1:9001
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <title>Supervisor Status</title>
  <link href="stylesheets/supervisor.css" rel="stylesheet" type="text/css" />
  <link href="images/icon.png" rel="icon" type="image/png" />
</head>
<body>
<div id="wrapper">

 ... bla bla bla
</div>

<div class="clr" id="footer">
  <div class="left">
    <a href="http://supervisord.org">Supervisor</a> <span>3.1.3</span>
  </div>
  <div class="right">
    &copy; 2006-<span>2015</span> <strong><a href="http://agendaless.com/">Agendaless Consulting and Contributors</a></strong>
  </div>
</div>
</body>

但如果我尝试从外界访问它,它会给我404:

root@gosthost:~# curl http://46.101.172.89/supervisor/
<head>
<title>Error response</title>
</head>
<body>
<h1>Error response</h1>
<p>Error code 404.
<p>Message: Not Found.
</body>

但那不是nginx的原生回复。我可以看到,因为nginx会签署自己的错误响应,请参阅下文。这是典型的nginx响应

curl http://46.101.172.89/media/
<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx/1.6.2</center>
</body>
</html>

所以主管有问题。那可能是什么?

1 个答案:

答案 0 :(得分:2)

有点晚了,但我遇到了同样的问题,并尝试了一切并找到了解决方案

p

你错过了proxy_pass http://127.0.0.1:9001/; :)