如何在nginx中设置请求接受头?
我需要将特定路径上任何URL的请求接受头设置为如何在nginx中设置请求接受头?,nginx,header,Nginx,Header,我需要将特定路径上任何URL的请求接受头设置为*/* 以下是当前正在设置的请求接受标头: GET /apiQuery/preview?view=location_csv&q=name:* HTTP/1.1 Host: www.blah.com Connection: keep-alive Cache-Control: max-age=0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*
*/*
以下是当前正在设置的请求接受标头:
GET /apiQuery/preview?view=location_csv&q=name:* HTTP/1.1
Host: www.blah.com
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
我希望它是:
GET /apiQuery/preview?view=location_csv&q=name:* HTTP/1.1
Host: www.blah.com
Connection: keep-alive
Cache-Control: max-age=0
Accept: */*
…对于/apiQuery/path上的任何URL。有一个模块可用于此目的,称为 缺点:此模块不与Nginx一起分发。您必须按照安装指南将此模块与Nginx集成 或者,如果您使用Nginx作为代理,则应该使用指令
proxy_set_header Accept '*/*';
proxy_set_header Accept '*/*';