2
1
In my use case I would like to create a sub domain with the main domain's IP address but with different port number. For example:
I have the the main domain as abc.com
pointing to 192.168.1.1
@ 192.168.1.1
I would like to create to a subdomain with port 8081 like below,
api.abc.com 192.168.1.1:8081
But it looks like it is not possible. So I tried to create a SRV record with the following information,
Name: api
Target: api.abc.com
Protocol: _http
Service: _http
Priority: 5
Weight: 5
Port: 8081
TTL: 1 hour
But this didn't help. Is there any way to achieve this? I am using Godaddy to manage my domains.
Could someone help me with this?
You should read about VirtualHosts. DNS record of the subdomain should point to your server's external IP address (and should not include a port number) – Alex – 2016-07-20T05:24:40.137
Maybe this can help you: <VirtualHost *:80> ServerAdmin me@mydomain.com ServerName dev.mydomain.com ProxyPreserveHost On # setup the proxy <Proxy *> Order allow,deny Allow from all </Proxy> ProxyPass / http://localhost:8888/ ProxyPassReverse / http://localhost:8888/ </VirtualHost> - sorry for not editing the post - I am still trying to learn how to do this on my phone.
– Alex – 2016-07-20T05:27:52.343