【问题标题】:How to run sites in subdirectories with NGINX如何使用 NGINX 在子目录中运行网站
【发布时间】:2023-01-11 05:16:24
【问题描述】:

我的 NGINX 应用程序如下所示:

server {
    listen 80;
    server_name server_domain_or_IP;

    location / {
        include proxy_params;
        proxy_pass http://unix:/home/ubuntu/home-app.sock;
    }

    location /memory-match {
        include proxy_params;
        proxy_pass http://unix:/home/ubuntu/mm-app.sock;
    }
}

/ 目录下的网站可以正常工作,但/memory-match 目录下的网站会报错“在服务器上找不到请求的 URL。如果您手动输入 URL,请检查拼写并重试。”

我知道这两个站点都可以工作,因为切换目录仍然会导致子目录无法正常工作。

非常感谢任何帮助或见解。

【问题讨论】:

    标签: nginx


    【解决方案1】:

    这最终成为 mm-app.sock 的问题。权限必须设置为用户/组的读/写(即chmod 660)。有关更多信息,请参阅this great tutorial

    【讨论】:

      猜你喜欢
      • 2012-12-20
      • 1970-01-01
      • 2015-02-15
      • 2016-06-20
      • 1970-01-01
      • 2014-01-06
      • 1970-01-01
      • 1970-01-01
      • 2020-03-05
      相关资源
      最近更新 更多