nginx add_header not working

后端 未结 8 861
无人共我
无人共我 2020-12-23 16:00

I am having an intriguing problem where whenever I use add_header in my virtual host configuration on an ubuntu server running nginx with PHP and php-fpm it sim

8条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-23 16:44

    I had the issue of not getting the response header due to the response code not within the allowed range, unless you specify the "always" keyword after the header value.

    From the official docs:

    Adds the specified field to a response header provided that the response code equals 200, 201, 204, 206, 301, 302, 303, 304, 307, or 308. The value can contain variables.

提交回复
热议问题