DNS. Sub domain to Domain:port
I've got a number of services running on my network and own my own domain name using DNSExit for Dynamic DNS.
I can change or add any DNS records using either my domain provider or DNS Exit.
I want to create proxies via Apache or direct via DNS (SRV Record?) from http://sub.domain.com to http://domain:com:port, but keep it cloaked so the port number doesn't show (not a redirect).
Anyone able to give me an idiot's guide?
Sent from my SM-G935F using Tapatalk
Re: DNS. Sub domain to Domain:port
Windows or Linux? If linux, does it have to be apache? I do more or less same thing with nginx and there's next to nothing to it to get it going.
Re: DNS. Sub domain to Domain:port
I'm using Linux and have managed to setup a reverse proxy, but the response time from the server (in a VM) is painful and takes ages for information to transfer the proxy.
I'm now looking at ways to do it via DNS directly, using SRV? Or even URL Forwarding with cloaking.
Are you using Nginx reverse proxy?
Sent from my SM-G935F using Tapatalk
Re: DNS. Sub domain to Domain:port
Yeah nginx is reverse proxying. I've not noticed any performance decrease at all.
What linux distribution is it?
Re: DNS. Sub domain to Domain:port
Linux Mint latest v17.3
Sent from my SM-G935F using Tapatalk
Re: DNS. Sub domain to Domain:port
add the following two lines to your /etc/apt/sources.list file
Code:
deb http://nginx.org/packages/ubuntu/ trusty nginx
deb-src http://nginx.org/packages/ubuntu/ trusty nginx
download the nginx signing key:
Code:
cd ~
wget http://nginx.org/keys/nginx_signing.key .
add the key to the db:
Code:
apt-key add ~/nginx_signing.key
update the list of installable apps:
install nginx:
Code:
apt-get install nginx
create the file for your website in /etc/nginx/conf.d/ for example mysite.conf
Code:
server {
server_name sub.domain.net;
listen 80;
# access_log /var/log/nginx/access.log;
# error_log /var/log/nginx/error.log;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://domain.com:port/;
proxy_read_timeout 90;
proxy_redirect off;
}
}
then restart niginx
Code:
service nginx restart
That should get it working, could tweak a bunch of stuff, like add SSL at the proxy to encrypt everything coming from the back end, but leave that for another day lol
Re: DNS. Sub domain to Domain:port
Spot on!! I'll give it a try. Means I'll have get rid of Apache first. It's currently listening on port 80.
Sent from my SM-G935F using Tapatalk
Re: DNS. Sub domain to Domain:port
Just change it to
and that way you can test that it's fast enough and that it handles the reverse proxying correctly before committing to removing your apache installation.