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

[求教]drupal 安装时出错:The provided host name is not valid for this server

  •  
  •   programV2 · Jan 18, 2020 · 1987 views
    This topic created in 2331 days ago, the information mentioned may be changed or developed.

    我是用 docker 跑 drupal,建站安装时出现这个错误: The provided host name is not valid for this server 该怎么排查,谢谢大家指点, 预祝大家春节快乐

    4 replies    2020-01-18 14:42:36 +08:00
    saeed
        1
    saeed  
       Jan 18, 2020
    $settings['trusted_host_patterns'] = array(
    '^172\.20.\0.\3$',
    '^localhost$',
    );
    programV2
        2
    programV2  
    OP
       Jan 18, 2020
    @saeed 谢谢 V 友, 请问我不是在本地安装, 是在 VPS 上, 这个 trusted_host_patterns 是写服务器 IP 还是绑定的域名?
    programV2
        3
    programV2  
    OP
       Jan 18, 2020
    @saeed 我在 dns 记录里把 www.example.com 做的 cname 指向 example.com, 这里只要写一条记录就可以了吗? 再次谢谢

    $settings['trusted_host_patterns'] = array(
    '^example\.com$',
    );
    programV2
        4
    programV2  
    OP
       Jan 18, 2020
    @saeed 我修改完 后重新启动容器, 浏览器输入域名出现

    An error occurred.
    Sorry, the page you are looking for is currently unavailable.
    Please try again later.

    If you are the system administrator of this resource then you should check the error log for details.

    Faithfully yours, nginx.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2892 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 05:45 · PVG 13:45 · LAX 22:45 · JFK 01:45
    ♥ Do have faith in what you're doing.