Nginx 跳过位置

Nginx 跳过位置

我在 Apache 前面安装了 nginx 来提供静态内容。但是,我希望 nginx 来提供页面服务,而不是转到 apache。

...
server {
location /nginx_status {
stub_status on;
}
}
include "/etc/nginx/vhosts/*";

但是,当我尝试访问它的 IP/nginx_status 时,我在 Apache 上收到 404 页面。

nginx -V
nginx version: nginx/1.4.1
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
TLS SNI support enabled
configure arguments: --with-http_flv_module --with-http_mp4_module --with-pcre=/usr/local/src/publicnginx/pcre-8.32 --sbin-path=/usr/local/sbin --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_realip_module --with-http_ssl_module --http-client-body-temp-path=/tmp/nginx_client --http-proxy-temp-path=/tmp/nginx_proxy --http-fastcgi-temp-path=/tmp/nginx_fastcgi --with-http_stub_status_module

答案1

固定的。

我需要在服务器下添加一个监听块。

相关内容