AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1056059
Accepted
James
James
Asked: 2021-03-06 06:42:58 +0800 CST2021-03-06 06:42:58 +0800 CST 2021-03-06 06:42:58 +0800 CST

网站响应 IP,但不响应域

  • 772

我在 AWS Lightsail Ubuntu 20.04 实例上托管了一个基于 Django 的网站,该网站在 Apache2 上运行。

使用 ip 18.133.43.205 时可以访问该网站。但是当我尝试使用域 roosta.xyz 搜索我的网站时,连接超时。

DNS 使用 AWS 的名称服务器。我不认为 DNS 是问题,因为当我进行 whois 查找时,它会显示 AWS 名称服务器,当我在 linux 终端中运行 dig roosta.xyz 时,会返回正确的 ip。

几天前,我收到了来自服务器的响应,但它要求使用 https,但我没有 ssl 证书,所以我的浏览器吓坏了。我不想使用https。但是在干预服务器后,试图阻止它想要使用 https,我现在又回到了连接超时。

另一件事是我在自己机器的终端上运行 curl roosta.xyz 并返回网页的 html?那么chrome怎么没有得到呢?!

这是 apache 虚拟主机配置文件的副本:

<VirtualHost *:80>
    ServerName www.roosta.xyz
    ServerAdmin webmaster@localhost
    ServerAlias roosta.xyz
    DocumentRoot /var/www/html

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /static /home/ubuntu/myWebsite/static
    <Directory /home/ubuntu/myWebsite/static>
        Require all granted
    </Directory>

    <Directory /home/ubuntu/myWebsite/myWebsite>
        <Files wsgi.py>
            Require all granted
        </Files>
    </Directory>

    WSGIScriptAlias / /home/ubuntu/myWebsite/myWebsite/wsgi.py
    WSGIDaemonProcess myWebsite_app python-path=/home/ubuntu/myWebsite python-home=/home/ubuntu/myWebsite/venv
    WSGIProcessGroup myWebsite_app 
</VirtualHost>

Apache2ctl -S

VirtualHost configuration:
*:80                   roosta.xyz (/etc/apache2/sites-enabled/myWebsite.conf:2)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex watchdog-callback: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33 not_used
Group: name="www-data" id=33 not_used

在网上搜索了几个小时后,我完全被难住了。我非常乐意提供更相关的代码或 lightsail 设置图片来帮助解决我的问题。

apache2 amazon-lightsail
  • 1 1 个回答
  • 176 Views

1 个回答

  • Voted
  1. Best Answer
    Bob
    2021-03-06T07:15:44+08:002021-03-06T07:15:44+08:00
    1. 您的问题的根源在于您的服务器没有响应 HTTPS。
      (如:在 TCP 端口 443 上根本没有响应。我的连接尝试只是不得不超时,因为您的服务器甚至没有返回“连接被拒绝”数据包。这通常是 DROP 而不是 REJECT 防火墙策略的效果) .

    2. 另一方面,Chrome 拒绝在纯 HTTP 上连接,因为它确定您的域的HSTS 策略 不允许这样做。由于该政策,Chrome 会调整任何http://www.roosta.xyzURL 并将其更改http为httpsURL。

    从 Chrome 测试 HSTS 策略:得到chrome://net-internals/#hsts

    HSTS 检查frosts.xyz

    您的域是预加载的 HSTS 列表的一部分(可能在https://hstspreload.org/上提交)
    请参阅:https://source.chromium.org/chromium/chromium/src/+/master:net/http/transport_security_state_static。 json

    要解决这个问题,您要么需要将您的域从 HSTS pe-load 列表中删除(短期内不会发生),要么您需要设置 TLS 以便您的站点显示在 https 上。

    • 2

相关问题

  • 如何转发来自我的网络服务器的请求?

  • 为什么 `apache2 -k graceful` 会出现此错误?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve