Want more timely Centmin Mod News Updates?
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

    55,156
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    8:40 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  2. eva2000

    eva2000 Administrator Staff Member

    55,156
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    8:40 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  3. rdan

    rdan Well-Known Member

    5,449
    1,410
    113
    May 25, 2014
    Ratings:
    +2,204
    Local Time:
    6:40 AM
    Mainline
    10.2
    I prefer this to be commented out by default :).
    Since mostly we don't use it.
     
  4. pamamolf

    pamamolf Premium Member Premium Member

    4,100
    428
    83
    May 31, 2014
    Ratings:
    +837
    Local Time:
    1:40 AM
    Nginx-1.26.x
    MariaDB 10.6.x
    Yup i prefer to have that also as commented as i do not use it.... :)
     
  5. eva2000

    eva2000 Administrator Staff Member

    55,156
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    8:40 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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";
       add_header Cache-Control "public, no-transform";
       try_files $uri$webp_extension $uri =404;
      }
    }
    
     
    Last edited: Dec 12, 2019
  6. rdan

    rdan Well-Known Member

    5,449
    1,410
    113
    May 25, 2014
    Ratings:
    +2,204
    Local Time:
    6:40 AM
    Mainline
    10.2
  7. eva2000

    eva2000 Administrator Staff Member

    55,156
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    8:40 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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
     
  8. eva2000

    eva2000 Administrator Staff Member

    55,156
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    8:40 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+