Getting 404 Not Found error while sending data to Elasticsearch via port 80

Hi,

I have installed elasticsearch and Kibana in my local (centOS) system.
I am using default port for elasticsearch(9200) and kibana(5601) .

My requirement is to send data from another server to my local server using http rest via 80 port.
I have neither configured any security nor SSL for this.
I am getting 404 "not found" response when I do rest call to elasticseach to send data via port 80.

Help me if you have any idea!

Thanks in advance :slight_smile:

What is running on port 80?

hi @dadoonet, nothing is running currently on port 80. it is free to use.

How could you get a 404 answer on localhost:80 if nothing is running at all?

Hi @dadoonet,

80 is default port and i am getting below when I browse with port 80:

"This page is used to test the proper operation of the Apache HTTP server after it has been installed. If you can read this page it means that this site is working properly. This server is powered by CentOS."

That means port is working fine but when I try to send data with rest http call, hostname:80, I am getting 404. Not sure why so?

Because you started an Apache server on that port, no?

I have absolutely no idea about what you are doing...

Hi @dadoonet,
My question is simple:
I want to send data with rest http call via port 80 to elasticsearch and getting 404 (not found) error, where nothing is running on port 80.

It is also mentioned in documentation that you can use 80 port to send data:

"The port number to use for this host. Note the default of 9200 is only true if the params are passed as an object. If a string, then default port is evaluated based on the protocol (80 for http, 443 for https)."

https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/host-reference.html

Elasticsearch does by default not listen to port 80, so if you want to use this you will need to forward traffic from port 80 to 9200. You can do this through port forwarding or by e.g. placing a proxy in front of Elasticsearch.

Thank you very much @Christian_Dahlqvist!!
It worked.

But now I have another issue. I am able to see index in kibana but I am not able to create the same index pattern.

Eg: I have sent data to index testing1. But when I am trying to click on "create Index" button, It is not creating the index.
I restarted Kibana service also but no luck :frowning:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.