Supervisor. Setting Up the Web Interface

In my previous article about Supervisor, I explained how to manage processes using supervisorctl in the console. Today I’ll explain how to start Supervisor’s web interface and monitor processes through the web. This can be useful for users who shouldn’t be given SSH access because they simply don’t need it for their work, but do need to view processes.
Installing the patched version
A while ago, I fixed some issues in Supervisor’s web interface, but the pull request still hasn’t been accepted. So I recommend installing it from my repository:
pip install -e git://github.com/adw0rd/supervisor.git#egg=supervisor
Configuring Supervisor
Open the file /usr/local/etc/supervisord.conf for editing and change the inet_http_server section to look like this:
[inet_http_server]
port=127.0.0.1:9001
username=<username> ; Сам я не указываю username/password,
password=<password> ; так как использую "auth_basic" для всего хоста в Nginx
Configuring Nginx
If you don’t want to use a subdomain for Supervisor, this configuration will help:
server {
listen 80;
server_name example.org;
location /supervisor/ {
rewrite ^/supervisor(.+)$ $1 break;
proxy_pass http://localhost:9001;
proxy_redirect http://example.org http://example.org/supervisor;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Otherwise, with a subdomain, it will look like this:
server {
listen 80;
server_name supervisor.example.org;
location / {
proxy_pass http://localhost:9001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Restart Nginx and Supervisor:
/usr/local/etc/rc.d/nginx reload
/usr/local/etc/rc.d/supervisord restart
Here’s what we should end up seeing when we open the web interface:

That’s it!
Comments are closed. Read the original discussion in Russian →