Discover Centmin Mod today
Register Now

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

    29,054
    6,594
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,790
    Local Time:
    6:52 PM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 1
  2. eva2000

    eva2000 Administrator Staff Member

    29,054
    6,594
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,790
    Local Time:
    6:52 PM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 1
  3. RoldanLT

    RoldanLT Well-Known Member

    3,831
    929
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,258
    Local Time:
    4:52 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,539
    231
    63
    May 31, 2014
    Ratings:
    +394
    Local Time:
    11:52 AM
    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

    29,054
    6,594
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,790
    Local Time:
    6:52 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,831
    929
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,258
    Local Time:
    4:52 PM
    1.11
    10.2
  7. eva2000

    eva2000 Administrator Staff Member

    29,054
    6,594
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,790
    Local Time:
    6:52 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

    29,054
    6,594
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,790
    Local Time:
    6:52 PM
    Nginx 1.13.x
    MariaDB 5.5