Created
April 23, 2019 15:27
-
-
Save Vincanote/2b18ba8aa33d068a9cc012b9a4d891af to your computer and use it in GitHub Desktop.
Elasticsearch7.0 nginx設定
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It works for me after changing
/statuses_
to/statuses
in line 13. Thanks.