Icinga+Nginx 配置

发布于 2024-12-18 06:57:14 字数 953 浏览 1 评论 0原文

我安装了 Icinga 1.6.0beta 并尝试使用此 手册安装它的新 Web 界面。但它是为 Apache 编写的。于是我使用了如下配置文件让nginx运行界面,但是没有成功。我在错误日志中发现目录列表被拒绝。有什么帮助吗?

注意:/data/developers/icinga-web 符号链接到 /usr/local/icinga-web

server {
server_name developers.example.com;
access_log /var/log/nginx/dev.access.log;
error_log /var/log/nginx/dev.error.log;
root /data/developers;

location / {
    index index.html index.htm index.php;
}

location /icinga-web/js/ext3/ {
    alias /usr/local/icinga-web/lib/ext3/;
}

location /icinga-web/ {
    if (!-e $request_filename) {
            rewrite ^(/icinga-web)(/.*)$ /icinga-web/index.php?$2 last;
    }
}

try_files $uri $uri/ /icinga-web/index.php?$args;
location ~ \.php$ {
    include /etc/nginx/fastcgi_params;

    fastcgi_split_path_info ^(/icinga-web)(/.*)$;

    fastcgi_pass  127.0.0.1:9000;
    fastcgi_index index.php;
}
}

I installed Icinga 1.6.0beta and tried to install it's new web interface using this manual. But it was written for Apache. So I used the following configuration file for nginx to run the interface, but no success. I get directory listing denied in error logs. Any help?

Note: /data/developers/icinga-web symlinked to /usr/local/icinga-web

server {
server_name developers.example.com;
access_log /var/log/nginx/dev.access.log;
error_log /var/log/nginx/dev.error.log;
root /data/developers;

location / {
    index index.html index.htm index.php;
}

location /icinga-web/js/ext3/ {
    alias /usr/local/icinga-web/lib/ext3/;
}

location /icinga-web/ {
    if (!-e $request_filename) {
            rewrite ^(/icinga-web)(/.*)$ /icinga-web/index.php?$2 last;
    }
}

try_files $uri $uri/ /icinga-web/index.php?$args;
location ~ \.php$ {
    include /etc/nginx/fastcgi_params;

    fastcgi_split_path_info ^(/icinga-web)(/.*)$;

    fastcgi_pass  127.0.0.1:9000;
    fastcgi_index index.php;
}
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

故人爱我别走 2024-12-25 06:57:15

几年后遇到了几乎同样的问题,迟到总比不好。 (我用“%”标记了你必须自己设置的变量)

location @icinga {
        include fastcgi.conf;
        fastcgi_temp_path fastcgi;
        fastcgi_pass  %YOUR_SOCKET%;
        fastcgi_param SCRIPT_NAME /icingaweb2/index.php;
        fastcgi_param SCRIPT_FILENAME %ICINGA_WEB_LOCATION%/index.php;
        fastcgi_param ICINGAWEB_CONFIGDIR %ICINGA_CONFIG_DIR%;
}
location /icingaweb2 {
    alias %ICINGA_WEB_LOCATION%/public;
    try_files $uri @icinga;
}

Ran into almost the same problems years later, better late than never. (I marked the variables you have to set yourself with " % ")

location @icinga {
        include fastcgi.conf;
        fastcgi_temp_path fastcgi;
        fastcgi_pass  %YOUR_SOCKET%;
        fastcgi_param SCRIPT_NAME /icingaweb2/index.php;
        fastcgi_param SCRIPT_FILENAME %ICINGA_WEB_LOCATION%/index.php;
        fastcgi_param ICINGAWEB_CONFIGDIR %ICINGA_CONFIG_DIR%;
}
location /icingaweb2 {
    alias %ICINGA_WEB_LOCATION%/public;
    try_files $uri @icinga;
}
谢绝鈎搭 2024-12-25 06:57:14

我遇到了同样的问题。我必须将以下行:

security.limit_extensions = .php .php5 .cgi 

放入 php-fpm 池配置文件中。

当然,在我输入之后,我现在收到以下行错误:

Parse error: syntax error, unexpected '<' in /usr/local/icinga/sbin/tac.cgi on line 313

但是嘿,进展!

I ran into the same problem. I had to put the following line:

security.limit_extensions = .php .php5 .cgi 

Into the php-fpm pool configuration file.

Of course, after I put that, I now get the following line error:

Parse error: syntax error, unexpected '<' in /usr/local/icinga/sbin/tac.cgi on line 313

But hey, progress!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文