# Node Red HTTP Request

**URL:** <https://discourse.nodered.org/t/node-red-http-request/26139>\
**Category:** General\
**Created:** [5 May 2020 15:45 UTC](https://discourse.nodered.org/t/node-red-http-request/26139 "2020-05-05T15:45:01Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexmanny](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@alexmanny](https://discourse.nodered.org/u/alexmanny)\
**Post date:** [5 May 2020 15:45 UTC](https://discourse.nodered.org/t/node-red-http-request/26139/1 "2020-05-05T15:45:02Z")

</div>

[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://google.com?john Can I have my node red server listen to h.t.t.p.s://google.com 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://mydomain.com and then I put in the browser h.t.t.p.s://mydomain.com?John 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://mydomain.com?john 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.  
Thanks.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [5 May 2020 15:53 UTC](https://discourse.nodered.org/t/node-red-http-request/26139/2 "2020-05-05T15:53:45Z")

</div>

> [@alexmanny](#):
>
> I just want to be able to enter in the URL h.t.t.p.s://mydomain.com?john and have my node red server listen to that URL and do an action based on john or bob or barry.

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](https://flows.nodered.org/search?term=http&type=flow).

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [5 May 2020 16:09 UTC](https://discourse.nodered.org/t/node-red-http-request/26139/3 "2020-05-05T16:09:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [5 May 2020 16:15 UTC](https://discourse.nodered.org/t/node-red-http-request/26139/4 "2020-05-05T16:15:10Z")

</div>

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

> [@alexmanny](#):
>
> I just want to be able to enter in the URL h.t.t.p.s://mydomain.com?john and have my node red server listen to that URL and do an action based on john or bob or barry.

... 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?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [5 May 2020 16:16 UTC](https://discourse.nodered.org/t/node-red-http-request/26139/5 "2020-05-05T16:16:23Z")

</div>

@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.

> [@alexmanny](#):
>
> 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://mydomain.com and then I put in the browser h.t.t.p.s://mydomain.com?John I get nothing in the debug window.

---

<div class="post-metadata">

**Author:** ![alexmanny](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@alexmanny](https://discourse.nodered.org/u/alexmanny)\
**Post date:** [5 May 2020 16:22 UTC](https://discourse.nodered.org/t/node-red-http-request/26139/6 "2020-05-05T16:22:39Z")

</div>

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 10.0.1.10:1880/test?bob I can see in the debug window ( msg.payload : Object { bob: "" }) so it works, but when I try [https://mydomain.com/test?bob](https://mydomain.com/test?bob) nothing happens.

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

Thanks.

---

<div class="post-metadata">

**Author:** ![alexmanny](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@alexmanny](https://discourse.nodered.org/u/alexmanny)\
**Post date:** [5 May 2020 16:25 UTC](https://discourse.nodered.org/t/node-red-http-request/26139/7 "2020-05-05T16:25:13Z")

</div>

Just to clarify, when enter in the browser [https://mydomain.com/test?bob](https://mydomain.com/test?bob) I already set the URL in the HTTP in node to [https://mydomain.com/test](https://mydomain.com/test)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [5 May 2020 16:30 UTC](https://discourse.nodered.org/t/node-red-http-request/26139/8 "2020-05-05T16:30:29Z")

</div>

> [@alexmanny](#):
>
> HTTP in node to [https://mydomain.com/test](https://mydomain.com/test)

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 [https://mydomain.com/test](https://mydomain.com/test) to be handled by your node-red instance running on [https://local-ip-address:1880/test](https://local-ip-address:1880/test) then, as I mentioned, you'll need to configure nginx to forward requests to that ip/port.

---

<div class="post-metadata">

**Author:** ![alexmanny](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@alexmanny](https://discourse.nodered.org/u/alexmanny)\
**Post date:** [5 May 2020 16:31 UTC](https://discourse.nodered.org/t/node-red-http-request/26139/9 "2020-05-05T16:31:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [4 July 2020 16:31 UTC](https://discourse.nodered.org/t/node-red-http-request/26139/10 "2020-07-04T16:31:42Z")

</div>

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