【发布时间】:2017-11-07 22:15:14
【问题描述】:
作为测试,我根据这些文章启用了 nginx 状态页面
server {
listen 80;
#listen on any host name
server_name _;
location /status {
stub_status on;
access_log off;
}
access_log /var/log/nginx/$host-access.log;
error_log /var/log/nginx/monitor-error.log;
}
我通常运行一个 wordpress 网站,并将任何 http 请求重定向到 https 请求:
server {
server_name _;
listen 80;
return 301 https://$host$request_uri;
}
我有几个 https 服务器块,每个 dns 都有一个,它有自己的服务器证书。
有没有什么办法可以把上面的两个server块结合起来,让正常的http请求重定向到https,但是如果使用/status url,会激活nginx状态页面?
【问题讨论】:
标签: nginx nginx-status