Want to subscribe to topics you're interested in?
Become a Member

Beta Branch add webp.conf map include file to nginx.conf

Discussion in 'Centmin Mod Github Commits' started by eva2000, Apr 30, 2017.

Tags:
  1. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    7:11 PM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 1
  2. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    7:11 PM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 1
  3. RoldanLT

    RoldanLT Well-Known Member

    3,901
    949
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,298
    Local Time:
    5:11 PM
    1.11
    10.2
    I prefer this to be commented out by default :).
    Since mostly we don't use it.
     
  4. pamamolf

    pamamolf Well-Known Member

    2,721
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    12:11 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Yup i prefer to have that also as commented as i do not use it.... :)
     
  5. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    7:11 PM
    Nginx 1.13.x
    MariaDB 5.5
    it does nothing being there uncommented anyway so no harm

    as you need to add nginx rules to reference $webp_extension to use it like outlined at Nginx Serving WebP Images Conditionally Demo
    Code (Text):
    location /webp {
      #pagespeed off;
      autoindex on;
      add_header X-Robots-Tag "noindex, nofollow";
      location ~* ^/webp/.+\.(png|jpe?g)$ {
       expires 30d;
       add_header Vary "Accept-Encoding";
       add_header Cache-Control "public, no-transform";
       try_files $uri$webp_extension $uri =404;
      }
    }
    
     
  6. RoldanLT

    RoldanLT Well-Known Member

    3,901
    949
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,298
    Local Time:
    5:11 PM
    1.11
    10.2
  7. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    7:11 PM
    Nginx 1.13.x
    MariaDB 5.5
    mapping does nothing if you do not reference the variable the map creates = $webp_extension in your vhosts

    mapping just makes $webp_extension variable available if you choose to use it in your nginx vhost nginx rules
     
    • Like Like x 1
  8. eva2000

    eva2000 Administrator Staff Member

    30,161
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    7:11 PM
    Nginx 1.13.x
    MariaDB 5.5