ruby-on-rails - 如何使用 nginx 作为代理将 redmine 移动到子 URI

我想把 redmine(监听 localhost:3000 standalone passenger)放在 nginx 后面,使用这个简单的 nginx 配置从 http://domain.com/redmine 服务:

server {
    location /redmine/ {                                                                                                                                                         
        proxy_pass      http://domain.com:3000/;
    }
}

我根据说明重写了redmine的config/environments.rb from this HOWTO ,并且 redmine 正确地重写了静态 Assets URL,但是 Controller URL 没有被重写,例如。设置指向 http://domain.com/settings 而不是 http://domain.com/redmine/settings

如何正确配置 redmine 以在 nginx 后面运行?

最佳答案

这是一件相当复杂的事情。你不会这么想,但确实如此。出现的每一个 redmine 版本都有一组不同的正确和错误的方法来完成这个。例如,我有一个工作配置 (nginx-1.4.1, unicorn, redmine-2.2.1) 但现在我使用的 (nginx-1.4.2, unicorn, redmine-2.3.3) 没有似乎工作了。以下是一些可能有用的链接:

  • http://www.redmine.org/issues/11881
  • http://www.redmine.org/issues/12102

https://stackoverflow.com/questions/18645070/

相关文章:

php - 使用 preg_replace 使序号全部小写

gcc - 编译外部内核模块时如何手动包含.config?

shell - 查找两个文件之间有多少行不同

image - 使用 gnuplot pm3d 和 pdf 输出生成的图像中有问题的莫尔图案

apache - 带加号的 URL 重定向

ssis - Camel 与 ETL 工具

c# - RestSharp - 找不到

opengl-es - 没有属性的顶点着色器

google-cloud-storage - 将大文件上传到谷歌云存储时超时

php - 在 PHPUnit 中测试工作链接