【问题标题】:map hostname to directoy nginx and accessable through http将主机名映射到目录 nginx 并通过 http 访问
【发布时间】:2018-04-06 01:38:15
【问题描述】:

我在 NGINX 上

我在以下位置安装了 wordpress: /home/kusanagi/wordpress1/DocumentRoot/ & /home/kusanagi/wordpress2/DocumentRoot

我的 IP 指向 wordpress1/DocumentRoot,但像 http://IP/wordpress2 这样的 id 指向 /home/kusanagi/wordpress2/DocumentRoot。

到目前为止,我尝试添加到 /etc/nginx/conf.d/_http.conf:

    location ~ /wordpress2 {
    root /home/kusanagi/wordpress2/DocumentRoot/;
    }

但我得到一个 502/404 或什么都没有。任何帮助,将不胜感激。

【问题讨论】:

    标签: wordpress nginx centos


    【解决方案1】:

    默认将你的ip指向“/home/kusanagi”这个路径并重启你的apache。

    然后您可以使用访问这两个网址

    http://ip/wordpress1

    http://ip/wordpress2

    【讨论】:

    • 我在 nginx 上,而不是 apache,我应该在哪里/如何做到这一点?
    • 你正在使用哪个操作系统用于 nginx
    • 我正在运行 CentOS
    • 我不明白?我如何“默认将您的 ip 指向“/home/kusanagi””?
    • 你也可以使用"service nginx restart"
    猜你喜欢
    • 2020-05-27
    • 1970-01-01
    • 2015-09-23
    • 1970-01-01
    • 2012-02-09
    • 1970-01-01
    • 1970-01-01
    • 2020-02-26
    • 1970-01-01
    相关资源
    最近更新 更多