nginx配置子域,但是无法访问

【字号: 日期:2022-07-15浏览:49作者:雯心

问题描述

nginx配置子域名,但是仍然无法访问,不知道是不是哪里错了,求大神帮忙看看~

server { listen 80; root /www/blog; index index.php index.html index.htm;server_name blog.xxx.com;}server { listen 443 ssl; root /www; index index.php index.html index.htm; server_name xxx.com ; error_page 404 = /404.html;#HTTPS #存放证书文件的位置 ssl_certificate /etc/ssl/ssl.crt; ssl_certificate_key /etc/ssl/ssl.key;}#301 redirectserver { listen 80; server_name xxx.com; return 301 https://xxx.com$request_uri;}

裸域做了一个欢迎页,并用了ssl以及301跳转到https,根目录是/www然后想把博客的域名设置子域名即blog.xxx.com,博客的根目录是/www/blog配置如上,正常访问xxx.com/blog的时候博客是会出来的,但是访问blog.xxx.com的时候直接跳到114导航去了...

已经修复了DNS劫持,但是还是无法访问,chrome显示“This webpage is not available”

问题解答

回答1:

添加 location 配置

回答2:

貌似一般出现跳到114导航这种情形,一般都是DNS解析错误或DNS劫持吧

回答3:

建议抓下包,看看有没有跳到你的服务器上

相关文章: