made docker container work with subdirectory (RAILS_RELATIVE_URL_ROOT)

This commit is contained in:
Markus Kahl
2020-01-28 08:57:45 +00:00
parent 22d5f77d8e
commit 7bb59dde9e
3 changed files with 12 additions and 10 deletions
+1 -8
View File
@@ -48,14 +48,7 @@ if defined?(Unicorn) && Rails.env.production?
use Unicorn::WorkerKiller::MaxRequests, min_req, max_req
end
##
# Returns true if the application should be run under a subdirectory.
def map_subdir?
# Don't map subdir when using Passenger as passenger takes care of that.
!defined?(::PhusionPassenger)
end
subdir = map_subdir? && OpenProject::Configuration.rails_relative_url_root.presence
subdir = OpenProject::Configuration.rails_relative_url_root.presence
map (subdir || '/') do
use Rack::Protection::JsonCsrf