我在我的 Centos 7 机器上安装了 nginx,并希望将调用转发到我在端口 5601 上安装的 kibana。Kibana 已启动并正在运行,并且能够通过将端口附加到浏览器中的 url 来浏览它。
我的 nginx.conf 文件如下
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
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/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/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/nginx/conf.d/*.conf;
}
在 conf.d 目录中,我放置了一个名为 default.conf 的文件,如下所示:
server {
listen 80;
server_name 192.168.33.36;
#auth_basic "Restricted Access";
#auth_basic_user_file /etc/nginx/htpasswd.users;
location / {
proxy_pass http://192.168.33.36:5601;
#proxy_http_version 1.1;
#proxy_set_header Upgrade $http_upgrade;
#proxy_set_header Connection 'upgrade';
#proxy_set_header Host $host;
#proxy_cache_bypass $http_upgrade;
}
}
我是 nginx 新手,所以我确定我在做一些愚蠢的事情,但我花了几个小时试图弄清楚。有谁知道怎么了?
Nginix 正在运行,因为当我浏览到端口 80 时,我会显示默认的 nginx 网页,但它不会转发到端口 5601