【发布时间】:2012-08-02 19:08:04
【问题描述】:
我正在使用 Play Framework 开发一个 web api。我使用 nginx 作为反向代理。由于api会被嵌入式系统使用,所以返回的信息应该尽可能的简洁。
Play Framework 在生产模式下的返回异常如下:(RAW HTTP 取自 Fiddler)
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
Cache-Control: no-cache
Content-Length: 14
aTqYu1mxQPy|10
但是,当我在用户和 api 之间放置 nginx 时,响应变成了这样:
HTTP/1.1 200 OK
Server: nginx/1.2.0
Date: Sun, 05 Aug 2012 15:08:31 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 14
Connection: close
Cache-Control: no-cache
aTqYu1mxQPy|10
我根本不需要 Server、Date、Connection 标头。它们由 nginx 自动添加。 (或者是因为我在之前的实验中弄乱了我的 nginx 配置)
有没有办法告诉 ngnix 不要告诉任何标头并原封不动地传递它们?
【问题讨论】:
标签: nginx