繁体   English   中英

如何配置 nginx 以指向特定的域站点以提供内容?

[英]How to configure nginx to point to specific domain sites to serve up content?

本质上,我正在尝试使用 nginx 提供位于http://local.pubsite.ed/samples/sample01.html的一些内容。

为此,回购的指示指示:

Use your host file to set this host pointer for two local websites. 
You will need webserver on your system for your environment. 
If you don't have IIS or Apache available, try nginx. 
Webserver configuration is beyond scope of this document.

local.digitru.st 127.0.0.1 local.pubsite.ed 127.0.0.1

Point your webserver and both sites to the root of your source repository. 
Access your site samples at:

http://local.pubsite.ed/samples/sample01.html

我已将/usr/local/etc/nginx/nginx.conf内部的 nginx root变量指向我的本地存储库/Users/zackcarlson/Desktop/Git/dt-cdn/ 然而,这并没有产生任何结果。

所以我最终删除/卸载 nginx 并按照本指南重新开始。

我会很感激一些关于如何继续让这个东西工作的指导。 提前致谢!

我已经测试了以下配置以使用来自DigiTrust 存储库的代码

server {
    listen 80;
    server_name local.pubsite.ed local.digitru.st
    index index.html;
    access_log logs/access.log combined;
    error_log logs/error.log error;

    location / {
        root /Users/zackcarlson/Desktop/Git/dt-cdn/;
    }
}

我可以确认这是有效的,看看这里

然而,这只是该项目的开始。 为了让它工作,我必须:

  1. 克隆回购
  2. 按照这个文档并按顺序运行yarn命令。

由于某种原因, grunt命令对我不起作用。

希望这可以帮助

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM