Skip to content

Instantly share code, notes, and snippets.

@Vincanote
Created April 23, 2019 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vincanote/2b18ba8aa33d068a9cc012b9a4d891af to your computer and use it in GitHub Desktop.
Save Vincanote/2b18ba8aa33d068a9cc012b9a4d891af to your computer and use it in GitHub Desktop.
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
Copy link

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