【问题标题】:Running Ghost on port 80 through NGINX (localhost)通过 NGINX (localhost) 在端口 80 上运行 Ghost
【发布时间】:2015-11-07 10:36:27
【问题描述】:

我正在使用本地主机和 Windows 操作系统。 NGINX 运行在 80 端口,Node.js 应用(Ghost)运行在 2368 端口。

我想使用 NGINX 作为 Ghost 应用程序的前端 Web 服务器。所以我在nginx.conf 文件中写道:

server {
    listen 80;
    server_name localghost;
    # change above to example.com in production mode
    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;
        proxy_pass         http://127.0.0.1:2368;
    }
}

NGINX 目录为C:\nginx,Ghost 目录为C:\nginx\www\ghost

http://localghost 地址未打开 Ghost 应用程序。我该怎么做?

【问题讨论】:

  • 您应该定义“localhost”的确切位置。您需要编辑您的 Windows 主机文件,使其转到 127.0.0.1。

标签: node.js windows nginx ghost


【解决方案1】:

localhost 能解决什么问题吗?

如果您在开发机器上进行测试,那么我建议您只使用 localhost 并完成它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-06-18
    • 1970-01-01
    • 2011-06-16
    • 2019-09-15
    • 2017-11-19
    • 1970-01-01
    • 1970-01-01
    • 2015-12-30
    相关资源
    最近更新 更多