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,452
    1,418
    113
    May 25, 2014
    Ratings:
    +2,212
    Local Time:
    4:18 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

    58,894
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    6:18 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    should just be mapped to $http_x_litespeed_cache_control
     
  3. rdan

    rdan Well-Known Member

    5,452
    1,418
    113
    May 25, 2014
    Ratings:
    +2,212
    Local Time:
    4:18 PM
    Mainline
    10.2
    Thanks, but still caching the page:
     
  4. eva2000

    eva2000 Administrator Staff Member

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

    rdan Well-Known Member

    5,452
    1,418
    113
    May 25, 2014
    Ratings:
    +2,212
    Local Time:
    4:18 PM
    Mainline
    10.2
    I already read that, and tried several ways, still lost :|
    Thanks.
     
  6. rdan

    rdan Well-Known Member

    5,452
    1,418
    113
    May 25, 2014
    Ratings:
    +2,212
    Local Time:
    4:18 PM
    Mainline
    10.2
    Anyone want to help? :D
    Still not able to figure out this :|