unit
unit copied to clipboard
Redmine uri bug?
I used nginx unit config for Redmine 5.0.1 with ruby 2.7.5 https://unit.nginx.org/howto/redmine/#redmine
But application add /config.ru/ to all uri
Can you please share your Unit configuration as well as as the version of Unit you are using at the moment?
Cheers Timo
@tippexs
{
"listeners": {
"*:80": {
"pass": "routes"
}
},
"routes": [
{
"action": {
"share": "/home/redmine/public_html/public$uri",
"fallback": {
"pass": "applications/rails"
}
}
}
],
"applications": {
"rails": {
"type": "ruby",
"script": "config.ru",
"working_directory": "/home/redmine/public_html/",
"environment": {
"RAILS_ENV": "production"
}
}
}
}
version
unitd --version
unit version: 1.27.0
configured as ./configure --prefix=/usr --state=/var/lib/unit --control=unix:/var/run/control.unit.sock --pid=/var/run/unit.pid --log=/var/log/unit.log --tmp=/var/tmp --user=unit --group=unit --tests --openssl --modules=/usr/lib/unit/modules --libdir=/usr/lib/x86_64-linux-gnu --cc-opt='-g -O2 -fdebug-prefix-map=/data/builder/debuild/unit-1.27.0/pkg/deb/debuild/unit-1.27.0=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' --ld-opt='-Wl,-Bsymbolic-functions -specs=/usr/share/dpkg/no-pie-link.specs -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie'
without "routes" same result
Can you please try to set SCRIPT_NAME in your environment to "" like
"applications": {
"rails": {
"type": "ruby",
"script": "config.ru",
"working_directory": "/home/redmine/public_html/",
"environment": {
"RAILS_ENV": "production",
"SCRIPT_NAME": ""
}
}
}
We have a know bug at the moment and this one will be fixed in the next release.
@tippexs same result also I have error in log error_unit.txt I use this ruby prebuilt packages https://launchpad.net/~brightbox/+archive/ubuntu/ruby-ng
A downgrade of Unit to Version 1.26.1 should help in this case. As said - there was a change to the SCRIPT_NAME handling in Ruby introduced within 1.27. Working on a bug fix and will ship it with 1.28.
Let me know if that works for you.
@tippexs Thanks. I do not need it urgent. I'll wait for fix. do you need more information for current config?
No that is probably totally fine for now. We already know what the issue is. Will keep this issue open till 1.28 release. Thanks for reporting that to us! Cheers
I applied a fix for a bug, that I think could fix your bug. Could you test building unit from source and check if you still have the bug?
Thanks!
@amg-web what the difference when using unit
Fixed with 1.28
Bugfix: force SCRIPT_NAME in Ruby to always be an empty string.