ip直接带端口访问正常,速度还行,域名访问速度极慢,有时还打不开,请问该怎么优化一下
server
{
listen 80;
server_name www.xxx.com;
rewrite ^(.*) https://www.xxx.com permanent;
}
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name www.xxx.com;
root /usr/share/nginx/html;
ssl_certificate /usr/local/nginx/conf/vhost/cert/www.xxx.com.cer;
ssl_certificate_key /usr/local/nginx/conf/vhost/cert/www.xxx.com.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
proxy_pass http://127.0.0.1:8001;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
那就是你域名解析的问题,和nginx没关系。你的域名的NS如果在国外可能会造成解析速度慢,客户端使用的dns服务器慢也会影响解析速度。