加入收藏 | 设为首页 | 会员中心 | 我要投稿 阜阳站长网 (https://www.0558zz.com/)- 科技、建站、内容创作、云计算、网络安全!
当前位置: 首页 > 运营中心 > Nginx > 正文

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

发布时间:2020-09-25 23:30:14 所属栏目:Nginx 来源:互联网
导读:我有/ 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;
    }
}

(编辑:阜阳站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读