First time using nginx. I want to forward any incoming request which looks like this: https://www.example.com/elasticsearch
to http://localhost:9200
with nginx. I wrote following in my nginx config in the http tag.
server {
listen 3333;
server_name www.example.com/elasticsearch;
return 301 $scheme://localhost:9200;
location / {
allow 'elasticsearch';
deny all;
}
}
Unfortunately when I use nginx -t
I receive following emerg:
nginx: [emerg] invalid parameter "elasticsearch" in /etc/nginx/nginx.conf:79