Kit Sunde Asked: 2012-10-09 08:44:03 +0800 CST2012-10-09 08:44:03 +0800 CST 2012-10-09 08:44:03 +0800 CST How can I globally set Cache-Control: no-expire on POST in an nginx config? 772 I'd like to set Cache-Control: no-expire but only on POSTs, what would be the correct way of doing that? nginx 1 Answers Voted Alexander Janssen 2012-10-09T09:38:32+08:002012-10-09T09:38:32+08:00 Like this (untested): http { if ($request_method = 'POST') { add_header 'Cache-Control' 'no-expire'; } }
Like this (untested):