我有一个/nginx_status的位置,我昨晚安装了一个SSL证书。
server { listen 443; ... location /nginx_status { stub_status on; access_log off; allow 127.0.0.1; deny all; } }
当它仍然在端口80上时,这是正在工作的pre-cert安装。现在,我有redirect到位redirectwww.domain.tld和domain.tldstream量到https
server { listen 80; server_name domain.tld; return 301 https://domain.tld$request_uri; } server { listen 80; server_name www.domain.tld; return 301 https://domain.tld$request_uri; }
我正在使用graphdat-relay来监视nginx的统计信息,现在curl http://127.0.0.1/nginx_status只是得到redirect页面例如
<html> <head><title>301 Moved Permanently</title></head> <body bgcolor="white"> <center><h1>301 Moved Permanently</h1></center> <hr><center>nginx/1.6.2</center> </body> </html>
如何告诉nginx绕过SSL并仅允许/ nginx_status 在本地 ?
为此只添加一个专门的服务器,只监听本地主机。
server { listen 127.0.0.1:80; listen [::1]:80; ... location /nginx_status { stub_status on; access_log off; allow 127.0.0.1; deny all; } }