简体   繁体   中英

Nginx default librenms PHP page blank

I have a default LibreNMS install on a fresh Debian Jessie server running nginx, but the default landing page (since there's no other virtual hosts) just shows a blank page. My nginx config in /etc/nginx/sites-available/default is like:

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    server_name _;
    root        /opt/librenms/html;
    index       index.php;
    access_log  /opt/librenms/logs/access_log;
    error_log   /opt/librenms/logs/error_log;
    location / {
            try_files $uri $uri/ @librenms;
    }
    location ~ \.php {
            fastcgi_param PATH_INFO $fastcgi_path_info;
            include fastcgi_params;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
    }
    location ~ /\.ht {
            deny all;
    }
    location @librenms {
            rewrite api/v0(.*)$ /api_v0.php/$1 last;
            rewrite ^(.+)$ /index.php/$1 last;
    }
}

The nginx -t passed, and nothing in /opt/librenms/logs/error_log , just an entry showing the browser I accessed from in /opt/librenms/logs/access_log . netstat shows nginx listening on port 80. What am I missing?

我从来没有让 Nginx 工作,但切换到 Apache2.4 并在 10 分钟内让它工作。

I am using LibreNMS on ubuntu/nginx server without any problem

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    server_name _;
    root        /opt/librenms/html;

Could you change the this part (given above) of your conf, after backing up, like below.

 listen      80;
 server_name 192.168.X.X;
 root        /opt/librenms/html;

Please don't forget to change server name IP address to your server IP. Then please reload.

# nginx -t
# nginx -s reload

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM