# How use only http://hostname/ instead of http://hostname:1880/ui

**URL:** <https://discourse.nodered.org/t/how-use-only-http-hostname-instead-of-http-hostname-1880-ui/85615>\
**Category:** General\
**Created:** [17 February 2024 15:46 UTC](https://discourse.nodered.org/t/how-use-only-http-hostname-instead-of-http-hostname-1880-ui/85615 "2024-02-17T15:46:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JorgeTorres01](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jorgetorres01/32/79909_2.png) [@JorgeTorres01](https://discourse.nodered.org/u/JorgeTorres01)\
**Post date:** [17 February 2024 15:46 UTC](https://discourse.nodered.org/t/how-use-only-http-hostname-instead-of-http-hostname-1880-ui/85615/1 "2024-02-17T15:46:47Z")

</div>

Hello,

I'm trying to use only [http://hostname/](http://hostname/) instade of [http://hostname:1880/ui](http://hostname:1880/ui)

I instaled the nginx and configured the file node-red with :

> sudo nano /etc/nginx/sites-available/node-red

with the following code

> server {  
> listen 80;  
> server\_name hostname;
> 
> ```
> location / {
> proxy_pass http://localhost:1880/ui;
> proxy_http_version 1.1;
> proxy_set_header Upgrade $http_upgrade;
> proxy_set_header Connection "upgrade";
> }
> 
> location = /:1880 {
> proxy_pass http://localhost:1880;
> proxy_http_version 1.1;
> proxy_set_header Upgrade $http_upgrade;
> proxy_set_header Connection "upgrade";
> }
> 
> location /phpmyadmin {
> alias /usr/share/phpmyadmin;
> index index.php;
> 
> location ~ \.php$ {
> try_files $uri =404;
> fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
> include fastcgi_params;
> }
> }
> 
> ```
> 
> }

but it only works if I use port 8080 and [http://hostname:8080/](http://hostname:8080/)  
When I use port 80 it doesn't work. I tried accessing with [http://hostname](http://hostname), [http://hostname:80](http://hostname:80)

I stopped and disabled Apache. But the problem persists.

It seems that port 80 is being used by some service and does not allow nginx to use port 80.

Does anyone have an idea of how to solve or alternative?

additional information:  
Raspberry Pi 4B (Raspberry OS 64 bits)  
installed Node-Red and LAMP (Linux, Apache, MySQL, PHP)

Thank you  
Jorge

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [17 February 2024 16:12 UTC](https://discourse.nodered.org/t/how-use-only-http-hostname-instead-of-http-hostname-1880-ui/85615/2 "2024-02-17T16:12:58Z")

</div>

> [@JorgeTorres01](#):
>
> Apache

> [@JorgeTorres01](#):
>
> nginx

Why are you running both? They do the same thing. And NGINX is significantly more efficient than Apache.

> [@JorgeTorres01](#):
>
> It seems that port 80 is being used by some service

You need to find out what. Not a good idea to leave unknown ports active anyway, what if it is malware?

Find out what is using it and kill it off or reconfigure it to use a different port. Then use NGINX to proxy everything.

---

<div class="post-metadata">

**Author:** ![JorgeTorres01](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jorgetorres01/32/79909_2.png) [@JorgeTorres01](https://discourse.nodered.org/u/JorgeTorres01)\
**Post date:** [17 February 2024 22:05 UTC](https://discourse.nodered.org/t/how-use-only-http-hostname-instead-of-http-hostname-1880-ui/85615/3 "2024-02-17T22:05:53Z")

</div>

Thank you  
He didn't know they both did the same.

I managed to solve it using Apache 🙂

I added it to the 000-default.conf file

> sudo nano /etc/apache2/sites-available/000-default.conf

and added the following lines:

> ```
> SetEnvIf Host ^(.*)$ HOSTNAME=$1
> 
> RewriteEngine On
> RewriteCond %{ENV:HOSTNAME} ^(.*)$
> RewriteRule ^/$ http://%1:1880/ui [L,R]
> ProxyPass /node-red http://%1:1880
> ProxyPassReverse /node-red http://%1:1880
> 
> #redireccionar para o phpmyadmin
> Alias /phpmyadmin /usr/share/phpmyadmin
> <Directory /usr/share/phpmyadmin>
> Options SymLinksIfOwnerMatch
> DirectoryIndex index.php
> </Directory>
> 
> ```

now with other PCs I already have access to the Node-Red Dashboard using just [http://hostname/](http://hostname/)

thank you again !

---

<div class="post-metadata">

**Author:** ![PizzaProgram](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pizzaprogram/32/19431_2.png) [@PizzaProgram](https://discourse.nodered.org/u/PizzaProgram)\
**Post date:** [22 February 2024 23:59 UTC](https://discourse.nodered.org/t/how-use-only-http-hostname-instead-of-http-hostname-1880-ui/85615/4 "2024-02-22T23:59:16Z")

</div>

@JorgeTorres01 Well done 🙂

Just to make sure:

- You are **not** doing this on an open Webserver do you?
- without using SSL, basic-auth, reverse proxy, etc...
- only on a local subnet or using VPN !

Right ?

_Opening NR to the WWW without properly securing it first is IT server-suicide, or worse._

---

<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:** [22 May 2024 23:59 UTC](https://discourse.nodered.org/t/how-use-only-http-hostname-instead-of-http-hostname-1880-ui/85615/5 "2024-05-22T23:59:19Z")

</div>

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