Node Red HTTP Request

[NOTE:] Sorry I had to make http look like h.t.t.p.s because when I try to post the forum says (only 2 addresses allowed for new users in a post)

Hi, super new to node red. I was wondering if there was a way to get a response by entering a URL. For example if I type in my browser h.t.t.p.s:// Can I have my node red server listen to h.t.t.p.s:// and when it see ?john, that it would be able to do another action within my server?

I might be asking the question all wrong, but I have an NGINX web server, that hosts my website, and I have node red on the same server. When I use an HTTP in node with GET then I call the URL h.t.t.p://local_ip:1880/test?John I can see that in the dbug window, but when I put the public URL of my webserver in the HTTP in node such as h.t.t.p.s:// and then I put in the browser h.t.t.p.s:// I get nothing in the debug window.

I know I'm missing something but sorry still learning.

I just want to be able to enter in the URL h.t.t.p.s:// and have my node red server listen to that URL and do an action based on john or bob or barry.

Any help is greatly appreciated.

Hi and welcome to node-red - hours of fun & some productivity.

Trigger a http request node & point it at your URL

inject --> http in --> debug node

once you get that going, you can get more adventurous.

Plenty of examples in the flow library.

Hi @alexmanny

so to summarise your question:

  1. you have created a flow starting with an HTTP In node that you can access using your local ip address
  2. you now want to access that same endpoint using your domain name, rather than local ip address.

To do that, you'll need to configure your NGINX server to forward traffic from your domain to your node-red instance.

We don't have a ready-to-roll example of how to do that, but I know others have shared their nginx configuration on the forum - so you could search for that.

I read it more like e wanted to get the query parameter bob or harry.

... admittedly, i didnt pay to much attention to the NGINX parts (as i often assume a new user is unsure what they really need & let them lead themselves to that by poking a few hints their way)

@alexmanny is that what you are trying to do?

@Steve-Mcl this was the key bit when I read it. Sounds like the request is working locally, but not when using the domain name.

Hi, thanks for all your replies. Thats correct everything works locally without any problems, when I put in the HTTP in node URL "/test" and I enter I can see in the debug window ( msg.payload : Object { bob: "" }) so it works, but when I try nothing happens.

Even though that NGINX web server is the same server node red is installed on.


Just to clarify, when enter in the browser I already set the URL in the HTTP in node to

The url in the HTTP In node is the path element - /test - not the full url including domain.

It then listens on that path on the http server node-red runs on port 1880 (by default).

If you want a request to to be handled by your node-red instance running on https://local-ip-address:1880/test then, as I mentioned, you'll need to configure nginx to forward requests to that ip/port.

Gotcha, going to try that, thanks a lot for your help.

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