Hi there,
I recently tried setting up icinga2 + icingaweb2 with nginx and postgresql on a
FreeBSD machine, but somehow the autogenerated icingaweb2-nginx configuration
does not seem to work.
This is my current nginx.conf:
http {
include mime.types;
default_type application/octet-stream;
server {
listen 80;
root /usr/local/share/icingaweb2/public;
location ~ ^/icingaweb2/index\.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME
/usr/local/share/icingaweb2/public/index.php;
fastcgi_param ICINGAWEB_CONFIGDIR /usr/local/etc/icingaweb2;
fastcgi_param REMOTE_USER $remote_user;
}
location ~ ^/icingaweb2(.+)? {
alias /usr/local/share/icingaweb2/public;
index index.php;
try_files $1 $uri $uri/ /icingaweb2/index.php$is_args$args;
}
}
}
The two "location" blocks were autogenerated as described in the docs and all
paths seem to be correct. When I visited http://<hostname>/icingaweb2 in my
browser, I was correctly forwarded to http://<myserver>/icingaweb2/setup. But
the page showed up with apparently no CSS, and the nginx error log shows:
2015/03/26 11:39:12 [error] 37802#0: *10 "/usr/local/etc/nginx/html/index.html"
is not found (2: No such file or directory), client: 127.0.0.1, server: ,
request: "GET / HTTP/1.0"
I presumed the directory should be icingaweb2/public, so I added the line
root /usr/local/share/icingaweb2/public;
to my nginx configuration (as already shown in the listing above). But now the
nginx error log reads
2015/03/26 11:42:12 [error] 37899#0: *10 directory index of
"/usr/local/share/icingaweb2/public/" is forbidden, client: 127.0.0.1, server:
, request: "GET / HTTP/1.0"
although the directory should be readable by nginx:
% ls -l /usr/local/share | grep icingaweb2
drwxr-xr-x 11 root wheel 17 Mar 25 21:54 icingaweb2/
% ls -l /usr/local/share/icingaweb2
total 63
-rw-r--r-- 1 root wheel 1088 Mar 25 21:54 AUTHORS
-rw-r--r-- 1 root wheel 18091 Mar 25 21:54 COPYING
-rw-r--r-- 1 root wheel 972 Mar 25 21:54 README.md
-rw-r--r-- 1 root wheel 13 Mar 25 21:54 VERSION
drwxr-xr-x 9 root wheel 9 Mar 25 21:54 application/
drwxr-xr-x 2 root wheel 4 Mar 25 21:54 bin/
drwxr-xr-x 4 root wheel 11 Mar 25 21:54 doc/
drwxr-xr-x 4 root wheel 4 Mar 25 21:54 etc/
-rw-r--r-- 1 root wheel 7707 Mar 25 21:54 icingaweb2.spec
drwxr-xr-x 4 root wheel 4 Mar 25 21:54 library/
drwxr-xr-x 7 root wheel 7 Mar 25 21:54 modules/
drwxr-xr-x 4 root wheel 5 Mar 25 21:54 packages/
drwxr-xr-x 6 root wheel 8 Mar 25 23:40 public/
drwxr-xr-x 3 root wheel 3 Mar 25 21:54 test/
Thanks for reading my lengthy description, but I'm a bit stuck here. Maybe
somebody has a hint on something I overlooked? Or somebody has a working
icingaweb2-nginx configuration and would be willing to share it? I doubt the
problem is FreeBSD-related, so a nginx.conf for any OS might help.
Please do not hesitate to ask if you need further details on my setup.
Thanks a lot in advance!
Kind regards,
Michael
--
Michael Pfeiffer <[email protected]>
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users