du5114 2016-04-02 14:31
浏览 200
已采纳

非常慢的Nginx下载ssl

i have this vhost

    server {
server_name admin.ex.com ;
listen 80 ;
listen [::]:80 ;
##SSL
#listen 443 ssl ;
  listen               *:443 ssl http2 ;
  listen               [::]:443 ssl http2 ;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

#ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:ECDHE-RSA-AES128-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA128:DHE-RSA-AES128-GCM-SHA384$
ssl_ciphers   EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/nginx/ssl/dhparam.pem;
ssl_session_timeout 10m;
ssl_session_cache   shared:SSL:10m;
ssl_certificate /etc/nginx/ssl/admin.crt;
ssl_certificate_key /etc/nginx/ssl/admin.key;

root /var/www/admin/public/;
index index.php index.html index.htm;
access_log /var/www/admin/admin.log;
auth_basic "Top Secret";
auth_basic_user_file /var/www/admin/.htpasswd;


        location / {
try_files $uri $uri/ =404;
allow 192.168.1.1;
#deny all;

location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.0-fpm.admin.sock;
fastcgi_intercept_errors on;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
}

}


}

its SO SLOW over HTTPS , i tried to visit phpmyadmin and my own php code over http it loads in 2 secs with HTTPS it takes 2-3 minutes , it loads the HTML code it self fast , but to download the resources (CSS-images) it takes so much time , i'm using chrome with the Nginx 1.9 and a self signed certificate . i even tried curl -i both the HTTP and HTTPS , again so much latency between the two , i don't understand what's going on !

UPDATE :: okay after some researching i figured out that if i take an image of exactly the same VPS and applied it to one which is in a server closer to me (Frankfurt instead of NY ) that it gets way faster . is it a distance problem then ? What makes me think again is that why when i use HTTP it's so fast no matter what server it is in .

Any ideas ?

  • 写回答

1条回答

  • dotwc62080 2016-04-05 01:09
    关注

    It turned out to be a location-related problem. I changed the location of the server from New York to Amsterdam which seems to solve the problem.

    I understand that a server can be far and thus reduce the connection speed but I don't understand why it reduces the speed under HTTPS only and not HTTP requests. Kind of weird!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示