• 请不要在回答技术问题时复制粘贴 AI 生成的内容
miaomiao2014
V2EX  ›  程序员

想要禁止通过 IP 地址访问,只允许通过域名访问。

  •  
  •   miaomiao2014 · Aug 9, 2023 · 1081 views
    This topic created in 1037 days ago, the information mentioned may be changed or developed.

    我想要禁止通过 IP 地址访问,只允许通过域名访问。 举例:whui.com 解析到了 182.194.245.65 ,whui.com:14500 能访问, 182.194.245.65:14500 被禁止访问。 我的 nginx 配置,如下见图,域名和 ip 都同时无法访问,怎么解决?谢谢。

    miaomiao2014
        1
    miaomiao2014  
    OP
       Aug 10, 2023
    有没有人知道吗?
    Projection
        2
    Projection  
       Aug 10, 2023
    没有看懂你的配置,18086 为什么出现了两次?到底开没开 TLS ?可以参考这篇文章:

    NGINX 配置避免 IP 访问时证书暴露域名
    https://zinglix.xyz/2021/10/04/nginx-ssl-reject-handshake/
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4974 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 09:33 · PVG 17:33 · LAX 02:33 · JFK 05:33
    ♥ Do have faith in what you're doing.