nginx configures the subdomain name, but still cannot access it. I don’t know if there is something wrong. Please help me~
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 redirect
server {
listen 80;
server_name xxx.com;
return 301 https://xxx.com$request_uri;
}
The naked domain made a welcome page and used SSL and 301 to jump to https. The root directory is /www
Then I want to set the blog domain name to a subdomain name, blog.xxx.com. The root directory of the blog is /www/blog
The configuration is as above. When you visit xxx.com/blog normally, the blog will appear, but when you visit blog.xxx.com, you will jump directly to the 114 navigation...
The DNS hijacking has been fixed, but it is still inaccessible. Chrome displays "This webpage is not available"
Add
location
configurationIt seems that the situation of jumping to 114 navigation is usually caused by DNS resolution error or DNS hijacking
It is recommended to grab the package and see if it jumps to your server