【发布时间】:2015-02-07 23:41:39
【问题描述】:
我有一个本地 ElasticSearch 服务器,由 Nginx 公开,可以防止 POST、PUT 和 DELETE 请求。这是我的 Nginx 配置足以防止超出信息获取的操作吗?您有什么改进建议吗?
upstream elasticsearch {
server localhost:9200;
}
server {
listen 7777;
location / {
return 403;
limit_except PUT POST DELETE {
proxy_pass http://elasticsearch;
}
proxy_redirect off;
}
}
谢谢。
[更新]
我根据deagh的建议配置:
upstream elasticsearch {
server localhost:9200;
}
server {
listen 7777;
location / {
return 403;
limit_except PUT POST DELETE {
proxy_pass http://elasticsearch;
}
proxy_redirect off;
}
location ~* ^(/_cluster|/_nodes|/_shutdown) {
return 403;
break;
}
}
【问题讨论】:
标签: nginx proxy elasticsearch