鍍金池/ 問答/Python  Linux/ nginx 域名訪問速度很慢優(yōu)化

nginx 域名訪問速度很慢優(yōu)化

ip直接帶端口訪問正常,速度還行,域名訪問速度極慢,有時(shí)還打不開,請(qǐng)問該怎么優(yōu)化一下

    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沒關(guān)系。你的域名的NS如果在國外可能會(huì)造成解析速度慢,客戶端使用的dns服務(wù)器慢也會(huì)影響解析速度。

2018年5月19日 23:29