I have a local ElasticSearch server promulgated by Nginx that prevents POST, PUT, and DELETE requests. Is my Nginx configuration enough to prevent operations that go beyond the collection of information? Do you offer improvements?
upstream elasticsearch { server localhost:9200; } server { listen 7777; location / { return 403; limit_except PUT POST DELETE { proxy_pass http://elasticsearch; } proxy_redirect off; } }
Thanks.
[UPDATE]
My configuration after deagh advice:
upstream elasticsearch { server localhost:9200; } server { listen 7777; location / { return 403; limit_except PUT POST DELETE { proxy_pass http://elasticsearch; } proxy_redirect off; } location ~* ^(/_cluster|/_nodes|/_shutdown) { return 403; break; } }
source share