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 Premium Member Premium Member

    5,112
    1,268
    113
    May 25, 2014
    Ratings:
    +1,937
    Local Time:
    6:22 AM
    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

    47,552
    10,791
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,776
    Local Time:
    8:22 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    should just be mapped to $http_x_litespeed_cache_control
     
  3. rdan

    rdan Premium Member Premium Member

    5,112
    1,268
    113
    May 25, 2014
    Ratings:
    +1,937
    Local Time:
    6:22 AM
    Mainline
    10.2
    Thanks, but still caching the page:
     
  4. eva2000

    eva2000 Administrator Staff Member

    47,552
    10,791
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,776
    Local Time:
    8:22 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
  5. rdan

    rdan Premium Member Premium Member

    5,112
    1,268
    113
    May 25, 2014
    Ratings:
    +1,937
    Local Time:
    6:22 AM
    Mainline
    10.2
    I already read that, and tried several ways, still lost :|
    Thanks.
     
  6. rdan

    rdan Premium Member Premium Member

    5,112
    1,268
    113
    May 25, 2014
    Ratings:
    +1,937
    Local Time:
    6:22 AM
    Mainline
    10.2
    Anyone want to help? :D
    Still not able to figure out this :|