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

    5,426
    1,389
    113
    May 25, 2014
    Ratings:
    +2,172
    Local Time:
    3: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

    50,897
    11,797
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,252
    Local Time:
    5:18 PM
    Nginx 1.25.x
    MariaDB 10.x
    should just be mapped to $http_x_litespeed_cache_control
     
  3. rdan

    rdan Well-Known Member

    5,426
    1,389
    113
    May 25, 2014
    Ratings:
    +2,172
    Local Time:
    3:18 PM
    Mainline
    10.2
    Thanks, but still caching the page:
     
  4. eva2000

    eva2000 Administrator Staff Member

    50,897
    11,797
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,252
    Local Time:
    5:18 PM
    Nginx 1.25.x
    MariaDB 10.x
  5. rdan

    rdan Well-Known Member

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

    rdan Well-Known Member

    5,426
    1,389
    113
    May 25, 2014
    Ratings:
    +2,172
    Local Time:
    3:18 PM
    Mainline
    10.2
    Anyone want to help? :D
    Still not able to figure out this :|