我有/ nginx_status的位置,昨晚我安装了SSL证书.
server {
listen 443;
...
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
}
当它仍然在端口80上时,这是在进行预证书安装.现在,我已经重定向到将www.domain.tld和domain.tld流量重定向到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统计数据,现在卷曲http://127.0.0.1/nginx_status只获取重定向页面,例如
如何告诉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;
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。