ubuntu – 在达到nginx状态时绕过localhost上的SSL

我有/ nginx_status的位置,昨晚我安装了SSL证书.server { listen 443; … location /nginx_status { stub_status on; access_log off; allow 127.0.0.1; deny

我有/ 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;
    }
}

作者: dawei

【声明】:滨州站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。

为您推荐

【免责声明】本站内容转载自互联网,其发布内容言论不代表本站观点,如果其链接、内容的侵犯您的权益,烦请提交相关链接至邮箱xwei067@foxmail.com我们将及时予以处理。

Copygight © 2016-2024 https://www.0543zz.com All Rights Reserved.滨州站长网

站长:xwei067#foxmail.com(请把#换成@)

联系我们

联系我们

0577-28828765

在线咨询: QQ交谈

邮箱: xwei067@foxmail.com

工作时间:周一至周五,9:00-17:30,节假日休息