Learn about Centmin Mod LEMP Stack today
Register Now

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

    5,434
    1,395
    113
    May 25, 2014
    Ratings:
    +2,181
    Local Time:
    11:50 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

    52,167
    11,995
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,498
    Local Time:
    1:50 AM
    Nginx 1.25.x
    MariaDB 10.x
    should just be mapped to $http_x_litespeed_cache_control
     
  3. rdan

    rdan Well-Known Member

    5,434
    1,395
    113
    May 25, 2014
    Ratings:
    +2,181
    Local Time:
    11:50 PM
    Mainline
    10.2
    Thanks, but still caching the page:
     
  4. eva2000

    eva2000 Administrator Staff Member

    52,167
    11,995
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,498
    Local Time:
    1:50 AM
    Nginx 1.25.x
    MariaDB 10.x
  5. rdan

    rdan Well-Known Member

    5,434
    1,395
    113
    May 25, 2014
    Ratings:
    +2,181
    Local Time:
    11:50 PM
    Mainline
    10.2
    I already read that, and tried several ways, still lost :|
    Thanks.
     
  6. rdan

    rdan Well-Known Member

    5,434
    1,395
    113
    May 25, 2014
    Ratings:
    +2,181
    Local Time:
    11:50 PM
    Mainline
    10.2
    Anyone want to help? :D
    Still not able to figure out this :|