【问题标题】:Page loads only on certain computers页面仅在某些计算机上加载
【发布时间】:2015-03-25 20:28:08
【问题描述】:

从现在开始,我只将我的服务器用于教育目的和编码视频。现在我想尝试使用 nginx 和 apache 在上面托管一些站点(为我的朋友),但问题是,即使它成功加载到我的计算机上,以及其他一些,我也看到页面没有'不加载,而不是只显示“欢迎使用 debian 上的 nginx”页面。 我怎样才能让它每次都能正常工作?

/etc/nginx/sites-available/uterfleru.cz:

server {
  listen          80;

  root /var/uterfleru.cz;
  index index.html index.php index.htm;

  server_name uterfleru.cz;
}

DNS - A:

uterfleru.cz    64.188.46.67
www.uterfleru.cz    64.188.46.67 

64.188.46.67 是我服务器的 ipv4, http://uterfleru.cz/ 是网页。

【问题讨论】:

    标签: apache nginx debian


    【解决方案1】:

    server_name uterfleru.cz; 就是uterfleru.cz 域名。要使这个server 块适用于www 子域,您必须修改它like that

    server_name www.uterfleru.cz uterfleru.cz;
    

    要使其适用于任何子域,您必须将其更改为:

    # synonym of *.uterfleru.cz uterfleru.cz;
    server_name .uterfleru.cz;
    

    要使此服务器块默认工作,您必须删除 /etc/nginx/sites-enabled/default.conf 文件并修改您的 listen 指令 like that

    listen 80 default;
    

    Official documentation 拥有您需要的所有信息,这是我见过的最好的软件文档之一,我强烈建议您学习使用它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-27
      • 2013-01-04
      • 1970-01-01
      相关资源
      最近更新 更多