0
点赞
收藏
分享

微信扫一扫

Zabbix5.0 初始化后访问Nginx时报404

c一段旅程c 2022-03-31 阅读 84
bashlinux

Zabbix5.0 初始化后访问Nginx时报404

原因

  • nginx默认使用/etc/opt/rh/rh-nginx116/nginx/nginx.conf然后才会使用/etc/opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf,如果使用默认80端口访问是显示nginx默认欢迎页,需要使用域名访问,无法跳转至zabbix页面

解决办法

# 方法一,将默认加载的nginx配置Server部分删掉,然后nginx就会去加载zabbix.conf了
[root@boy ~]# cat /etc/opt/rh/rh-nginx116/nginx/nginx.conf
# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/

user nginx;
worker_processes auto;
error_log /var/opt/rh/rh-nginx116/log/nginx/error.log;
pid /var/opt/rh/rh-nginx116/run/nginx/nginx.pid;

# Load dynamic modules. See /opt/rh/rh-nginx116/root/usr/share/doc/README.dynamic.
include /opt/rh/rh-nginx116/root/usr/share/nginx/modules/*.conf;

events {
    worker_connections  1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/opt/rh/rh-nginx116/log/nginx/access.log  main;

    sendfile        on;
    tcp_nopush      on;
    tcp_nodelay     on;
    keepalive_timeout  65;
    types_hash_max_size 2048;

    include       /etc/opt/rh/rh-nginx116/nginx/mime.types;
    default_type  application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/opt/rh/rh-nginx116/nginx/conf.d/*.conf;
}

# 方法二,修改zabbix.conf中的监听端口,不监听80
[root@boy ~]# grep listen /etc/opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf 
        listen          80;
举报

相关推荐

Zabbix5.0

zabbix5.0安装

zabbix5.0安装文档

Centos 7安装Zabbix5.0实战

0 条评论