Can nginx add custom headers to html?
漂亮男人
漂亮男人 2017-05-16 17:20:42
0
1
420

I want nginx to read a configuration string when receiving a request, if it is a specific file, add it to the header of this html file, and return it together as a custom header. Is it possible?
Or is there any other way to send the string in the configuration file together with the html file, instead of going through the overhead of another ajax request for a string?

漂亮男人
漂亮男人

reply all(1)
阿神

It can be realized. The location conditions can be combined with regular expressions. Use add_header to increase the content of the returned http header

add_header X-Hello world
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!