Join the community today
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

    35,061
    7,740
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,935
    Local Time:
    5:37 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    • Like Like x 1
  2. eva2000

    eva2000 Administrator Staff Member

    35,061
    7,740
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,935
    Local Time:
    5:37 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    • Like Like x 1
  3. rdan

    rdan Premium Member Premium Member

    4,223
    1,027
    113
    May 25, 2014
    Ratings:
    +1,467
    Local Time:
    3:37 AM
    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

    3,108
    294
    83
    May 31, 2014
    Ratings:
    +529
    Local Time:
    10:37 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

    35,061
    7,740
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,935
    Local Time:
    5:37 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    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. rdan

    rdan Premium Member Premium Member

    4,223
    1,027
    113
    May 25, 2014
    Ratings:
    +1,467
    Local Time:
    3:37 AM
    Mainline
    10.2
  7. eva2000

    eva2000 Administrator Staff Member

    35,061
    7,740
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,935
    Local Time:
    5:37 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    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

    35,061
    7,740
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,935
    Local Time:
    5:37 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
..