D
D
Dmitry2015-05-28 17:04:44
Nginx
Dmitry, 2015-05-28 17:04:44

How to make nginx caching proxy return last-modified from backend?

It is necessary to force the caching proxy on nginx to give the last-modified header from the backend (the backend provides it). The location configuration is as follows:

location /file.js {
    proxy_pass http://some-domain.com;
    sub_filter "subject" "replacement";
    sub_filter_types "text/javascript";
    sub_filter_once off;
    proxy_set_header Accept-Encoding "";
    proxy_pass_header Server;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2015-05-28
@blasterdick

sub_filter_last_modified on;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question