# I want to run 2 webservers behind one IP, should I use frp or HAproxy?

**URL:** <https://dietpi.com/forum/t/i-want-to-run-2-webservers-behind-one-ip-should-i-use-frp-or-haproxy/14689>\
**Category:** General Discussion\
**Tags:** proxy, web-server, multiple\
**Created:** [21 October 2022 22:49 UTC](https://dietpi.com/forum/t/i-want-to-run-2-webservers-behind-one-ip-should-i-use-frp-or-haproxy/14689 "2022-10-21T22:49:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)\
**Post date:** [21 October 2022 22:49 UTC](https://dietpi.com/forum/t/i-want-to-run-2-webservers-behind-one-ip-should-i-use-frp-or-haproxy/14689/1 "2022-10-21T22:49:14Z")

</div>

My idea is to run 2 webservers on 2 seperate RPis. (One for nextcloud and the other for a tiny minecraft server. I need a webserver on the minecraft machine so that the users can turn on and off / restart the minecraft server remotely)

I could use [frp](https://dietpi.com/docs/software/advanced_networking/#frp) or [HAproxy](https://dietpi.com/docs/software/advanced_networking/#haproxy) for this, I think, but:

1. Is it even possibly to run the proxy on the same machine where one of the webservers a running?
2. And should I use 2 domains to determine which server is used (layer 4 I guess), or should I use layer 7 balancing? (like `domain.example/nextcloud` uses the proxy machine and `domain.example/minecraft` uses the other one)

What methode would you recommend for this? I think I will also write a tutorial for the forum about this, but befor I dig deeper I want to hear your opinions.

Thanks in advance!

edit: typo

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [22 October 2022 04:59 UTC](https://dietpi.com/forum/t/i-want-to-run-2-webservers-behind-one-ip-should-i-use-frp-or-haproxy/14689/2 "2022-10-22T04:59:34Z")

</div>

Quite a lot of things are possible. Simply use the web server of Nextcloud as reverse proxy. This way, no additional software would be needed.

---

<div class="post-metadata">

**Author:** ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)\
**Post date:** [22 October 2022 10:35 UTC](https://dietpi.com/forum/t/i-want-to-run-2-webservers-behind-one-ip-should-i-use-frp-or-haproxy/14689/3 "2022-10-22T10:35:31Z")

</div>

Edit: nevermind, I will try something else first.

Original message: I’m still on lighttpd. Can I just remove lighttpd and install nginx or what is the recommend method to switch the webserver?

---

<div class="post-metadata">

**Author:** ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)\
**Post date:** [22 October 2022 16:55 UTC](https://dietpi.com/forum/t/i-want-to-run-2-webservers-behind-one-ip-should-i-use-frp-or-haproxy/14689/4 "2022-10-22T16:55:33Z")

</div>

After some considerations I think the simplest and easiest solution I can live with is, to let the router do the work with some simple port forwarding 😁

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [22 October 2022 21:39 UTC](https://dietpi.com/forum/t/i-want-to-run-2-webservers-behind-one-ip-should-i-use-frp-or-haproxy/14689/5 "2022-10-22T21:39:27Z")

</div>

> [@Jappe](#):
>
> to let the router do the work with some simple port forwarding 😁

yes that’s possible and might be easiest

Theoretically Lighttpd could have done the job as well. But it might be not that simply to configure Lighttpd as revers proxy. There, Apache or Nginx are more common and easier to manage as proxy.
