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

前端之家收集整理的这篇文章主要介绍了ubuntu – 在达到nginx状态时绕过localhost上的SSL前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有/ Nginx_status的位置,昨晚我安装了SSL证书.
  1. server {
  2. listen 443;
  3. ...
  4. location /Nginx_status {
  5. stub_status on;
  6. access_log off;
  7. allow 127.0.0.1;
  8. deny all;
  9. }
  10. }

当它仍然在端口80上时,这是在进行预证书安装.现在,我已经重定向到将www.domain.tld和domain.tld流量重定向到https,例如

  1. server {
  2. listen 80;
  3. server_name domain.tld;
  4. return 301 https://domain.tld$request_uri;
  5. }
  6.  
  7. server {
  8. listen 80;
  9. server_name www.domain.tld;
  10. return 301 https://domain.tld$request_uri;
  11. }

我正在使用graphdat-relay来监控Nginx统计数据,现在卷曲http://127.0.0.1/Nginx_status只获取重定向页面,例如

  1. <html>
  2. <head><title>301 Moved Permanently</title></head>
  3. <body bgcolor="white">
  4. <center><h1>301 Moved Permanently</h1></center>
  5. <hr><center>Nginx/1.6.2</center>
  6. </body>
  7. </html>

如何告诉Nginx绕过SSL并仅在本地允许/ Nginx_status?

为此添加一个仅侦听本地主机的特殊服务器.
  1. server {
  2. listen 127.0.0.1:80;
  3. listen [::1]:80;
  4. ...
  5. location /Nginx_status {
  6. stub_status on;
  7. access_log off;
  8. allow 127.0.0.1;
  9. deny all;
  10. }
  11. }

猜你在找的Ubuntu相关文章