nginx代理背后的Openstack API

时间:2014-04-08 18:56:09

标签: nginx proxy openstack

我试图隐藏nginx代理后面的openstack api。

location /image/api {
  proxy_pass http://192.168.200.1:9292/;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header Host $host;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

当我使用扫视图像列表

[08/Apr/2014:18:15:07 +0200] 185.39.228.x - - -  to: 192.168.200.1:5000: POST /identity/main/tokens HTTP/1.1 upstream_response_time 0.077 msec 1396973707.015 request_time 0.077
185.39.228.x - - [08/Apr/2014:18:15:07 +0200] "POST /identity/main/tokens HTTP/1.1" 200 4128 "-" "python-keystoneclient"
[08/Apr/2014:18:15:07 +0200] 185.39.228.x - - -  to: 192.168.200.1:9292: GET /image/api/v1/images/detail?sort_key=name&sort_dir=asc&limit=20 HTTP/1.1 upstream_response_time 0.202 msec 1396973707.280 request_time 0.202
185.39.228.x - - [08/Apr/2014:18:15:07 +0200] "GET /image/api/v1/images/detail?sort_key=name&sort_dir=asc&limit=20 HTTP/1.1" 200 3381 "-" "python-glanceclient"

但是当我使用地平线时我会收到错误

[08/Apr/2014:18:15:29 +0200] 217.20.186.x - - -  to: -: GET /v1/images/detail?limit=21 HTTP/1.1 upstream_response_time - msec 1396973729.046 request_time 0.000
217.20.186.x - - [08/Apr/2014:18:15:29 +0200] "GET /v1/images/detail?limit=21 HTTP/1.1" 404 177 "-" "python-glanceclient"

我看到地平线之后的链接有点削减,但为什么呢?

1 个答案:

答案 0 :(得分:0)

似乎地平线发送的请求比python客户端更大,超过了nginx的默认限制。对我来说,设置

large_client_header_buffers 4 16k;

解决了这个问题。