Shinken behind a reverse proxy
Shinken uses its own engine to serve web pages. This is what causes the WebUI to be attacked via port 7767 by default. It's a bit ugly so go put an nginx proxy in front.
Installing nginx
1
|
apt–get install nginx
|
We delete the vhost by default
1
|
rm /etc/nginx/sites–enabled/default
|
We create a new vhost under / etc / nginx / sites-available / shinken and we put the following lines there
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
server {
# IPv4 support
listen 80;
server_name name.domainname.tld;
# Proxy
location / {
proxy_pass http://localhost:7767;
include proxy_params;
}
# Serve static content directly
location /static/(.*/)? {
try_files htdocs/$uri plugins/$1/htdocs/$uri @webui;
}
location @webui {
root /var/lib/shinken/modules/webui/;
}
}
|
We activate the vhost
1
2
|
cd /etc/nginx/site–enabled
ln –s /etc/nginx/sites–available/shinken shinken
|
We relaunch nginx
1
|
/etc/init.d/nginx restart
|
Finished !