Last active
August 29, 2015 14:01
-
-
Save gnurag/57de8fe4c4377c231444 to your computer and use it in GitHub Desktop.
Apache configuration for securing ElasticSearch server.
This file contains hidden or 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
| <VirtualHost *:80> | |
| DocumentRoot /var/www/html | |
| ServerName app-example.rhcloud.com | |
| ServerAlias alias1-example.rhcloud.com | |
| ProxyRequests Off | |
| ProxyVia Off | |
| Header set Access-Control-Allow-Origin "*" | |
| # Proxy Redirect for ElasticSearch. | |
| ProxyPass /es http://localhost:9200 connectiontimeout=5 timeout=300 | |
| ProxyPassReverse /es http://localhost:9200 | |
| <LocationMatch /es> | |
| Order deny,allow | |
| Deny from all | |
| </LocationMatch> | |
| <LocationMatch "/es/.+/_search"> | |
| Order allow,deny | |
| Allow from all | |
| <Limit PUT DELETE> | |
| Deny from all | |
| </Limit> | |
| </LocationMatch> | |
| # Additionally, on SELinux enabled hosts | |
| # # setsebool -P httpd_can_network_connect true | |
| </VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment