可以根据URL路径解析DNS [英] possible to resolve DNS based on URL path

查看:148
本文介绍了可以根据URL路径解析DNS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的理解是,将两个相关网站放在同一个域下有一定的优势,而不是单独的子域(例如不同书籍类型的子网站)。我能想到的两个是使用相同的SSL证书和SEO排名。

My understanding is that there are certain advantages to putting two related sites under the same domain, as opposed to separate subdomains (for example sub-sites for different book genres). Two I can think of are using the same SSL cert, and SEO rankings.

我想让不同的路径让同一个域解析到不同的IP地址。例如 example.com/a 100.100.100.100 example.com/b 200.200.200.200 。我知道这对于传统的DNS服务器是不可能的,但是否有其他技术或商业服务可以实现这一目标?理想情况下,我也可以动态地改变路径解析的位置,因为不同的服务器开启或离线。

I'd like to have different paths for the same domain resolve to different IP addresses. For example example.com/a to 100.100.100.100 and example.com/b to 200.200.200.200. I know this isn't possible with traditional DNS servers, but are there other techniques or commercial services out there that would accomplish this? Ideally I'd be also able to dynamically change where the paths resolve to as well, as different servers come on or offline.

推荐答案

那是不可能做到的; DNS的名称到IP解析只考虑主机名。

That can't be done; DNS' name to IP resolution only considers the hostname.

您可以通过托管反向代理来实现类似的结果,例如 nginx example.com ,然后直接查询 / a 100.100.100.100 / b 200.200.200.200

You could achieve a similar result by hosting a reverse proxy like nginx atexample.com, and then direct queries for /a to 100.100.100.100 and for /b to 200.200.200.200.

这篇关于可以根据URL路径解析DNS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆