I would like to setup a reverse proxy that proxies based on the hostname/servername.
I would normally do this with something like Nginx or Apache.
I have looked around in this forum and only seen a couple of questions that where related but non appeared relevant to me scenario.
I have noticed I could install tinyproxy which but it seams to me that it doesn’t do hostname based.
In the tinyproxy documentation I noticed the ReverseBaseURL parameter but it seams to me from the description of it and from the examples that I have managed to find around the can only be one ReverseBaseURL.
Does this mean that I cannot do what I want with tiny proxy or rather that I must have each proxy rule for each host on separate .conf files? - if so how would I go about doing this? do I just add the path to the other config on the main config? or do I need to run something on the command line to add the other configs to the tinyproxy process?
In the case of not being able to use tinyproxy could I use nginx on the router itself? I am concerned if it might be an issue in terms of performance and such.
This is my scenario
DNS CNAME record for
URL1
URL2
URL3
Are pointing to my public IP.
Then
URL1 get proxied to IP1
URL2 get proxied to IP2
URL3 get proxied to IP3
luci can be used to install packages, but I’m sure you can’t avoid ssh when setting up the server anyway. (and you might need to handle stuff around “collision” with the default lighttpd, too)
hmmm ok so the turris front end is served by lighthttpd web server.
I wonder if I can use that same service to proxy my requests.
I also wonder I dont need the proxy to work internally just for request coming from the internet.
So in case I had to work with lighthttpd and nginx binded only to the wan interface so I can leave lighthttpd on port 80? remote access to turris front end its not on port 80 right?
I had read something about it… but I am more interesting on other stuff at the moment once I got my setup like I want it then I will start looking in to backups, restore processes.
HTTP["host"] =~ "URL1$" {
url.rewrite-once = ("^/(.*)" => "$0/somepath/$1")
# In lighttpd we alter the path manually using rewrite rule. %0
# refers to the hostname and $1 is the path.
proxy.server = ( "" =>
( (
"host" => "IP1",
"port" => "PORT"
) )
)
}
My recomendation is to use something else as reverse proxy if possible… a LXC container, another dedicated host, a container somewhere… basically isolating services just in case something bad happens (security breach or whatever). If you are running a reverse proxy in the router itself and there is a vulnerability on that component, your entire network can be compromised.
My 2 cents.