/ etc / hosts中具有127.0.0.1的条目未使用NGINX重定向

问题描述

我试图在也是Web服务器的工作站上为长URL设置别名。每当我尝试在浏览器中转到这些别名时,我都会重定向到标准的Welcome to nginx!页面。

/ etc / hosts:

127.0.0.1 sonarr sonarr.home sonarr.home.*** # Sonarr

站点可用/启用:

server {
    listen                  80;
    listen                  [::]:80;

    server_name             sonarr sonarr.home sonarr.home.***;

    return                  301 https://sonarr.home.***$request_uri;
}

server {
    listen                  443 ssl http2;
    listen                  [::]:443 ssl http2;

    server_name             sonarr.home.***;

    ssl_certificate         /etc/letsencrypt/live/home.***/fullchain.pem;
    ssl_certificate_key     /etc/letsencrypt/live/home.***/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/home.***/chain.pem;

    include                 snippets/authelia.conf;
    include                 snippets/ssl.conf;
    include                 snippets/misc.conf;
    include                 snippets/waf.conf;

    location / {
        proxy_pass          http://sonarr:26682;
        include             snippets/proxy.conf;
        include             snippets/auth.conf;
        modsecurity_rules_file /etc/nginx/modsec/sites/sonarr.conf;
    }
}

我在随附的ssl.conf文件中也有此文件:

resolver                   127.0.0.1 valid=60s;
resolver_timeout           2s;

我还安装了dnsmasq。尝试转到http://sonarr.home/后进入流量日志时,我看到服务器名称(sn)为127.0.0.1,$ host为sonarr.home:

127.0.0.1 - - [16/Aug/2020:03:25:19 -0400] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0" "-" "sonarr.home" sn="127.0.0.1" rt=0.000 ua="-" us="-" ut="-" ul="-" cs=-

我想念什么?我该如何做才能进入http://sonarr.home/并将我重定向到https://sonarr.home.***?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)