首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法将Caddy服务器配置为在我的域名中使用TLS

无法将Caddy服务器配置为在我的域名中使用TLS
EN

Stack Overflow用户
提问于 2021-02-05 02:21:56
回答 1查看 1.1K关注 0票数 0

我已经将域的A/AAAA记录指向了我的服务器的IP地址,当我将服务器的IP地址放在浏览器中而不是使用域名时,我确实看到了Caddy主页。

不确定我的Caddyfile更改是否正在重新加载。

浏览器中的点击:

代码语言:javascript
复制
http://10.20.30.40 -- I see Caddy home page when I hit my machine's ip address
http://www.mytekworld.com -- The browser just keeps spinning when I hit the domain name
https://www.mytekworld.com -- The browser just keeps spinning when I hit the domain name

sudo nano /etc/caddy/Caddyfile

代码语言:javascript
复制
# The Caddyfile is an easy way to configure your Caddy web server.
#
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
#
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace the line below with your
# domain name.
www.mytekworld.com

# Set this path to your site's directory.
root * /usr/share/caddy

# Enable the static file server.
file_server

# Another common task is to set up a reverse proxy:
# reverse_proxy localhost:8080

# Or serve a PHP site through php-fpm:
# php_fastcgi localhost:9000

# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile

--Reload

代码语言:javascript
复制
caddy reload
sudo systemctl reload caddy --caddy.service is not active, cannot reload.

防火墙状态:

代码语言:javascript
复制
Status: active

     To                         Action      From
     --                         ------      ----
[ 1] 22000                      ALLOW IN    Anywhere
[ 2] 80,443/tcp                 ALLOW IN    Anywhere
[ 3] 8080                       ALLOW IN    Anywhere
[ 4] 22786 (v6)                 ALLOW IN    Anywhere (v6)
[ 5] 80,443/tcp (v6)            ALLOW IN    Anywhere (v6)
[ 6] 8080 (v6)                  ALLOW IN    Anywhere (v6)
EN

回答 1

Stack Overflow用户

发布于 2021-02-05 02:43:55

这似乎是DNS问题。

确保你的A唱片看起来像这样

代码语言:javascript
复制
A 10.20.30.40

如果您的A记录格式正确,请使用DNS记录和DNS提供程序(Cloudflare、Netlify、Godaddy等)更新您的问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66056706

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档