Learn about Centmin Mod LEMP Stack today
Become a Member

Nginx PageSpeed If I'll try to use CDN

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by rdan, Aug 18, 2014.

  1. rdan

    rdan Premium Member Premium Member

    5,301
    1,328
    113
    May 25, 2014
    Ratings:
    +2,052
    Local Time:
    10:51 PM
    Mainline
    10.2
  2. eva2000

    eva2000 Administrator Staff Member

    49,039
    11,235
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,488
    Local Time:
    12:51 AM
    Nginx 1.21.x
    MariaDB 10.x
  3. eva2000

    eva2000 Administrator Staff Member

    49,039
    11,235
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,488
    Local Time:
    12:51 AM
    Nginx 1.21.x
    MariaDB 10.x
    even better :)
     
  4. rdan

    rdan Premium Member Premium Member

    5,301
    1,328
    113
    May 25, 2014
    Ratings:
    +2,052
    Local Time:
    10:51 PM
    Mainline
    10.2
    Maybe you can advice more to my config? :D
    Code:
    server {
        listen 80;
        server_name static.phcorner.net;
    
        # ngx_pagespeed & ngx_pagespeed handler
        include /usr/local/nginx/conf/pagespeed_phcorner.conf;
        include /usr/local/nginx/conf/pagespeedhandler.conf;
        include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
            access_log off;
        log_not_found off;
        error_log off;
        root /home/nginx/domains/phcorner.net/public;
    
        location / {
            if ($request_filename ~ "\.(3gp|gif|jpg|jpeg|png|ico|webp|swf|flv|zip|tar|rar|gz|tgz|bz2|7z|doc|docx|xls|xlsx|pdf|iso|js|css|eot|svg|ttf|woff|woff2)$") {
                    break;
                    }
            return 301 http://www.phcorner.net$request_uri;
            }
        include /usr/local/nginx/conf/staticfiles.conf;
        include /usr/local/nginx/conf/drop.conf;
    }
     
  5. eva2000

    eva2000 Administrator Staff Member

    49,039
    11,235
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,488
    Local Time:
    12:51 AM
    Nginx 1.21.x
    MariaDB 10.x
    looks fine to me :)
     
  6. rdan

    rdan Premium Member Premium Member

    5,301
    1,328
    113
    May 25, 2014
    Ratings:
    +2,052
    Local Time:
    10:51 PM
    Mainline
    10.2
    Do I still need this includes on static server_name?
    include /usr/local/nginx/conf/staticfiles.conf;
    include /usr/local/nginx/conf/drop.conf;
    :)
     
  7. eva2000

    eva2000 Administrator Staff Member

    49,039
    11,235
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,488
    Local Time:
    12:51 AM
    Nginx 1.21.x
    MariaDB 10.x
    try without
     
  8. rdan

    rdan Premium Member Premium Member

    5,301
    1,328
    113
    May 25, 2014
    Ratings:
    +2,052
    Local Time:
    10:51 PM
    Mainline
    10.2
  9. rdan

    rdan Premium Member Premium Member

    5,301
    1,328
    113
    May 25, 2014
    Ratings:
    +2,052
    Local Time:
    10:51 PM
    Mainline
    10.2
    For static files, SPDY/HTTPS is still helpful?
     
  10. eva2000

    eva2000 Administrator Staff Member

    49,039
    11,235
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,488
    Local Time:
    12:51 AM
    Nginx 1.21.x
    MariaDB 10.x
  11. eva2000

    eva2000 Administrator Staff Member

    49,039
    11,235
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,488
    Local Time:
    12:51 AM
    Nginx 1.21.x
    MariaDB 10.x
    I still have my keycdn CDN account, so going to try re-deploying it on the forums again :D
     
  12. rdan

    rdan Premium Member Premium Member

    5,301
    1,328
    113
    May 25, 2014
    Ratings:
    +2,052
    Local Time:
    10:51 PM
    Mainline
    10.2
    Yeah I'm seeing cdnk1.centminmod.com on my browser status bar :D
     
  13. eva2000

    eva2000 Administrator Staff Member

    49,039
    11,235
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,488
    Local Time:
    12:51 AM
    Nginx 1.21.x
    MariaDB 10.x
    that's it :)
     
  14. eva2000

    eva2000 Administrator Staff Member

    49,039
    11,235
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,488
    Local Time:
    12:51 AM
    Nginx 1.21.x
    MariaDB 10.x
    keycdn performance has definitely improved since I last time I enabled it on this forum :)
     
  15. rdan

    rdan Premium Member Premium Member

    5,301
    1,328
    113
    May 25, 2014
    Ratings:
    +2,052
    Local Time:
    10:51 PM
    Mainline
    10.2
    What makes you say that?
    Cloudflare CDN seems work great than any CDN for me :).
    and it's free.
     
  16. eva2000

    eva2000 Administrator Staff Member

    49,039
    11,235
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,488
    Local Time:
    12:51 AM
    Nginx 1.21.x
    MariaDB 10.x
    metrics I analyse and gather for the forums across all geographical regions for visitors :)

    I say that in relative terms keycdn now is better than keycdn used previously.

    Cloudflare is no longer an option for me due to custom SSL ciphers and main site using GeoDNS which Cloudflare don't offer if you want to direct folks to specific backend origins.
     
  17. rdan

    rdan Premium Member Premium Member

    5,301
    1,328
    113
    May 25, 2014
    Ratings:
    +2,052
    Local Time:
    10:51 PM
    Mainline
    10.2
    No need as static request will be serve on their closest datacenter.
     
  18. eva2000

    eva2000 Administrator Staff Member

    49,039
    11,235
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,488
    Local Time:
    12:51 AM
    Nginx 1.21.x
    MariaDB 10.x
    true but not if you want it done youself your own way - whole point is showing off what Centmin Mod LEMP stack can do, not what Cloudflare can do :)
     
  19. eva2000

    eva2000 Administrator Staff Member

    49,039
    11,235
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,488
    Local Time:
    12:51 AM
    Nginx 1.21.x
    MariaDB 10.x
    had to disable KeyCDN again on this forum.. there's a noticeable lag on first page views :(
     
  20. Cr0w

    Cr0w Member

    165
    9
    18
    Mar 17, 2015
    Iran
    Ratings:
    +13
    Local Time:
    7:21 PM
    1.9.x
    5.5
    is't any ways to transfer CSS,JS,Images to another subdomain ? and loading directly without rewrite ?
    example.com/file.css to cdn.example.com ( on another document root )
    /home/nginx/domains/example.com/public ~ /home/nginx/domains/cd.example.com/public

    ??