What's new

route external wild card domain to internal proxy

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

waeking

Regular Contributor
I do not want to open up port 80 and forward to traefik running on an internal pc unless the specific domain is used. For example if I go to the External Static IP (http://123.456.123.456:80) I dont want anything to happen. However if I go to fresh.pxy.domain,com I would like that to go to the actual traefik proxy. I know how to setup the dns wildcard A record (*.pxy.domain.com). That has been done.

I can't seem to find any documentation on this as of yet. I am not sure what I should even be searching for.

Any assistance would be great!
 
Code:
 iptables -t nat -A PREROUTING -d *.pxy.domain.com -i eth0 -p tcp -m tcp -j DNAT --to-destination 192.168.1.100
would something like this work?
 
Code:
 iptables -t nat -A PREROUTING -d *.pxy.domain.com -i eth0 -p tcp -m tcp -j DNAT --to-destination 192.168.1.100
would something like this work?
No, because iptables translates a domain name into an IP address when the command is issued. It also doesn't accept wildcards.
 
Would some sort of reverse proxy built into the router (wan facing) be able to do this? or would two reverse proxies (router and traefik) be able to communicate with each other?
 
I would have thought it would make sense to do this on the web server as that is able to examine the URL of the incoming requests. I guess you could do it on a reverse proxy as well. Beyond that I don't know. It's not really my area of knowledge.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top