您好我在Route53上注册了两个域,www.sample.com
和sample.com
现在www.sample.com
一条记录指向一个绑定到EC2的弹性IP(使用Django + Gunicorn + Nginx)。 www.sample.com网站工作得非常好所以我尝试将sample.com的A记录重新路由到同一个ip,但我一直在解决问题DNS address could not be found.
任何人都知道为什么?
我是否还必须将nginx
配置文件更改为正在收听sample.com
?
这是配置文件
server {
listen 80;
server_name www.sample.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name www.sample.com
# add Strict-Transport-Security to prevent man in the middle attacks
add_header Strict-Transport-Security "max-age=31536000";
ssl_certificate /etc/nginx/ssl/sample_com/ssl-bundle.crt;
ssl_certificate_key /etc/nginx/ssl/sample_com/sample_com.key;
# side note: only use TLS since SSLv2 and SSLv3 have had recent vulnerabilities
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
root /home/ubuntu/sample_Landing_page/;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
alias /home/ubuntu/sample_Landing_page/static/static_root/;
expires 365d;
}
location / {
include proxy_params;
proxy_pass
http://unix:/home/ubuntu/sample_Landing_page/sample_Landing.sock;
}
}