Join the community today
Become a Member

Nginx How to map Nginx http response header?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by rdan, Mar 31, 2020.

  1. rdan

    rdan Well-Known Member

    4,962
    1,183
    113
    May 25, 2014
    Ratings:
    +1,797
    Local Time:
    5:07 PM
    Mainline
    10.2
    I tried several configs but seems to not work, like...

    Code:
    map $upstream_http_x_litespeed_cache_control $nocacheheader {
        default      0;
        no-cache   1;
        }
    
    Code:
    map $sent_http_x_litespeed_cache_control $nocacheheader {
        default      0;
        no-cache   1;
        }
    
    Page is still cached.
    What is the correct format?

    My HTTP response header:
    Thanks!
     
  2. eva2000

    eva2000 Administrator Staff Member

    44,780
    10,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,828
    Local Time:
    7:07 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    should just be mapped to $http_x_litespeed_cache_control
     
  3. rdan

    rdan Well-Known Member

    4,962
    1,183
    113
    May 25, 2014
    Ratings:
    +1,797
    Local Time:
    5:07 PM
    Mainline
    10.2
    Thanks, but still caching the page:
     
  4. eva2000

    eva2000 Administrator Staff Member

    44,780
    10,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,828
    Local Time:
    7:07 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
  5. rdan

    rdan Well-Known Member

    4,962
    1,183
    113
    May 25, 2014
    Ratings:
    +1,797
    Local Time:
    5:07 PM
    Mainline
    10.2
    I already read that, and tried several ways, still lost :|
    Thanks.
     
  6. rdan

    rdan Well-Known Member

    4,962
    1,183
    113
    May 25, 2014
    Ratings:
    +1,797
    Local Time:
    5:07 PM
    Mainline
    10.2
    Anyone want to help? :D
    Still not able to figure out this :|