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

    58,894
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    6:25 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
  2. eva2000

    eva2000 Administrator Staff Member

    58,894
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    6:25 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
  3. rdan

    rdan Well-Known Member

    5,452
    1,418
    113
    May 25, 2014
    Ratings:
    +2,212
    Local Time:
    4:25 PM
    Mainline
    10.2
    I prefer this to be commented out by default :).
    Since mostly we don't use it.
     
  4. pamamolf

    pamamolf Well-Known Member

    4,125
    429
    83
    May 31, 2014
    Ratings:
    +841
    Local Time:
    11:25 AM
    Nginx-1.29.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

    58,894
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    6:25 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    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,452
    1,418
    113
    May 25, 2014
    Ratings:
    +2,212
    Local Time:
    4:25 PM
    Mainline
    10.2
  7. eva2000

    eva2000 Administrator Staff Member

    58,894
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    6:25 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    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

    58,894
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    6:25 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+