I want to use TLS and HTTP Basic authentication together prevents anyone from intercepting communication with Elasticsearch. How do I do it? 1) htpasswd -c /usr/local/apache/password/.htpasswd_elasticsearch magento_elasticsearch 2) Set up proxy for apache 2.4 Listen 8080 /etc/apache2/sites-available/000-default.conf <VirtualHost *:8080> ProxyPass "/" "http://localhost:9200/" ProxyPassReverse "/" "http://localhost:9200/" </VirtualHost> 3) Secure communication with Apache /etc/apache2/sites-available/default-ssl.conf Code: <Proxy *> Order deny,allow Allow from all AuthType Basic AuthName "Elastic Server" AuthBasicProvider file AuthUserFile /usr/local/apache/password/.htpasswd_elasticsearch Require valid-user # This allows OPTIONS-requests without authorization <LimitExcept OPTIONS> Require valid-user </LimitExcept> </Proxy>