大网数据广告活动
服务器运维问答

Lightsail instance requests time out with domain name but work with IP address

· 52CE 我爱测

I'm attempting to create a BookStack site on an Amazon Lightsail instance. I'm having an issue where my static public IP address attached to my Lightsail instance will go to my site just fine, from any browser or computer. Howeve…

问题原文

原帖链接 · Ash · CC BY-SA 4.0

I'm attempting to create a BookStack site on an Amazon Lightsail instance.

I'm having an issue where my static public IP address attached to my Lightsail instance will go to my site just fine, from any browser or computer. However, my domain address I pointed to that same IP will time out and not work.

The OS is Ubuntu 18.04, IP is [IP], domain is [domain].dev.This is the script BookStack uses to setup on Ubuntu 18.04. Virtual host configuration is below.

I've tried/done the following:

  • I host with Google Domains and I've gone to my DNS and added A records for @ (base domain) and www that points to my static ip. Didn't work.
  • I created a DNS zone through the Lightsail console pointing @ and www to my static IP. I then added the Amazon nameservers to my Google Domain's nameservers instead of Google's. Didn't work.
  • I tried the above again using Route 53 and configuring the nameservers there instead of using Lightsail's DNS zones, but that didn't work either.

When I ping the static IP it times out and I don't get a response, but from what I've read online that can be normal for some website. When I ping my domain it resolves to the right IP address but also doesn't get a response.

I'm confused as to why pinging my domain gives me the right IP address but the website still refuses to load. I've been trying over multiple days so it shouldn't be a propagation issue. The website will load via IP but not by using the domain.

<VirtualHost *:80>
    ServerName [domain].dev

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/bookstack/public/

    <Directory /var/www/bookstack/public/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
        <IfModule mod_rewrite.c>
            <IfModule mod_negotiation.c>
                Options -MultiViews -Indexes
            </IfModule>

            RewriteEngine On

            # Handle Authorization Header
            RewriteCond %{HTTP:Authorization} .
            RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

            # Redirect Trailing Slashes If Not A Folder...
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteCond %{REQUEST_URI} (.+)/$
            RewriteRule ^ %1 [L,R=301]

            # Handle Front Controller...
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^ index.php [L]
        </IfModule>
    </Directory>

    ErrorLog /error.log
    CustomLog /access.log combined

</VirtualHost>

已采纳解答

原帖链接 · Ash · CC BY-SA 4.0

So the solution was quite...interesting. To say the least I'm quite frustrated it has taken this long for me to figure this out but here it is:

From what I understand Google owns the .dev TLD and have since required an SSL certificate (https://) to host a domain on a .dev domain. Since I did not have one yet, it wasn't working. So the solution would be to either move to a new domain without .dev or add an SSL certificate to your site.

I've since moved to a different domain I own to make sure it works, and sure enough it does.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-07-11)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。