Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Elasticsearch7.0 nginx設定
server {
listen 9200;
server_name [nginxの鯖のIP];
root /var/www;
rewrite_log on;
error_page 405 = $uri;
location / {
proxy_pass http://[ElasticSearchの鯖のIP]:9200;
}
location /statuses_ {
if ( $request_method ~ ^(PUT)$ ) {
rewrite ^(.+)$ $1?include_type_name=true break;
}
proxy_pass http://[ElasticSearchの鯖のIP]:9200;
}
location ~ _search$ {
rewrite ^(.+)$ $1?rest_total_hits_as_int=true break;
proxy_pass http://[ElasticSearchの鯖のIP]:9200;
}
}
@sorz

This comment has been minimized.

Copy link

@sorz sorz commented May 11, 2019

It works for me after changing /statuses_ to /statuses in line 13. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment