summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2025-02-04 09:40:38 +0000
committerGo MAEDA <maeda@farend.jp>2025-02-04 09:40:38 +0000
commit17e07afdc826a6ea054fd73651e50bfa86f53284 (patch)
tree6fe4440a432f42b404fe90cd4b882854b5d481ee
parent0a47eef4c3719592864d2ea7b7cc0d6411348977 (diff)
downloadredmine-17e07afdc826a6ea054fd73651e50bfa86f53284.tar.gz
redmine-17e07afdc826a6ea054fd73651e50bfa86f53284.zip
Expose default Rails health check endpoint "/up" for load balancers and uptime monitoring (#42008).
Patch by Lorenz Schori (user:znerol). git-svn-id: https://svn.redmine.org/redmine/trunk@23487 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--config/routes.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 563ffe1e2..c6572761a 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -412,6 +412,10 @@ Rails.application.routes.draw do
get 'help/wiki_syntax/(:type)', :controller => 'help', :action => 'show_wiki_syntax', :constraints => { :type => /detailed/ }, :as => 'help_wiki_syntax'
get 'help/code_highlighting', :controller => 'help', :action => 'show_code_highlighting', :as => 'help_code_highlighting'
+ # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
+ # Can be used by load balancers and uptime monitors to verify that the app is live.
+ get "up" => "rails/health#show", as: :rails_health_check
+
Redmine::Plugin.directory.glob("*/config/routes.rb").sort.each do |plugin_routes_path|
instance_eval(plugin_routes_path.read, plugin_routes_path.to_s)
rescue SyntaxError, StandardError => e