我们使用kong作为我们的API网关,并且有一些端点的响应时间超过60秒。根据Nginx的documentation,我可以用proxy_read_timeout来改变这一点,但这个设置没有任何影响,我不知道为什么。
我们使用kong作为码头容器。下面是Dockerfile的摘录
FROM mashape/kong:0.9.5
COPY nginx.conf.custom /usr/local/kong/nginx.conf.custom
COPY nginx-kong.conf.custom /usr/local/kong/nginx-kong.conf.custom
...我们的nginx-kong.conf.custom文件与默认文件相同,除了以下位置/块中的摘录。
location / {
set $upstream_host nil;
set $upstream_url nil;
access_by_lua_block {
kong.access()
}
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $upstream_host;
proxy_pass_header Server;
proxy_pass $upstream_url;
proxy_read_timeout 180s;
proxy_connect_timeout 75s;
header_filter_by_lua_block {
kong.header_filter()
}
body_filter_by_lua_block {
kong.body_filter()
}
log_by_lua_block {
kong.log()
}
}发布于 2017-04-18 09:02:08
此页面对https://getkong.org/docs/0.10.x/configuration/有帮助吗?或者,如果没有,我们欢迎Or改进文档-您可以在此处找到该页面的源代码https://github.com/Mashape/getkong.org/blob/master/app/docs/0.10.x/configuration.md
https://stackoverflow.com/questions/43453223
复制相似问题