Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

how to access built-in health checks via dispatcher/internet?

Avatar

Level 7

might be explained with an example:

 

Any ideas on how to get this to work?

The reason why I'm asking is that our AEM "architecture" is using 3rd-party platform called "OpenCloud". This platform provides its own health checker servlet (http://localhost:4502/system/health and http://localhost:4503/system/health) and I want to access this path.

thank you.

EDIT:


This is the content of my /filters section

# Deny everything
/0001 { /type "deny"  /glob "*" }

# Enable Health Check Servlet
/0006 { /type "allow" /method "GET" /url "/system/health*" }

#I have other lines in the filters section but I have commented them

 

my dispatcher config

<IfModule dispatcher_module>
    DispatcherConfig            "/etc/httpd/conf.modules.d/dispatcher.farms.any"
    DispatcherLog               /var/log/httpd/dispatcher.log
    DispatcherLogLevel          warn
    DispatcherNoServerHeader    off
    DispatcherDeclineRoot       off
    DispatcherUseProcessedURL   1
    DispatcherPassError         0
</IfModule>
1 Accepted Solution

Avatar

Correct answer by
Level 6

@jayv25585659 My bad; I meant to send the LogLevel with `Debug`. If you want, you can go with `Trace2` to get more detailed logging on why it is blocked. Tail this log file `tail -f /var/log/httpd/dispatcher.log` and check what is happening. Here are a few things you can focus on to debug: 

  1. Is the request logged in dispatcher.log? 
  2. Is the path logged in the dispatcher the path you're requesting? Or is it being rewritten by the rewrite engine and forwarded to the dispatcher? 
  3. What is the passthrough path hitting publish instance? 

View solution in original post

2 Replies

Avatar

Employee Advisor

@jayv25585659 Please share a snippet from dispatcher logs to see what's the error while accessing the URL at the dispatcher level

Avatar

Level 7

I edited my original reply.

I tried the following:

  • browsed http://www.my-host.com/system/health and nothing showed up in /var/log/httpd/dispatcher.log

  • I ran this curl -vvv -k https://localhost/system/health and got this reply. I also got nothing in the logs.

    <html><head>
    <title>404 Not Found</title>
    </head><body>
    <h1>Not Found</h1>
    <p>The requested URL was not found on this server.</p>
    </body></html>

Avatar

Level 6

@jayv25585659 

There must be another rule in dispatcher filters which might be blocking it. Change the dispatcher log level to debug or trace and restart the dispatcher to notice which rule is blocking it. 

Define DISP_LOG_LEVEL Warn Debug

 

Instead of allowing everything -> /0001 { /type "allow" /glob "*" } set allow rule with specific path 

# /health_check { /type "allow" /url "/system/health" }   

 

 

Avatar

Level 7
  • I will check the log level. I think it's already using "warn".

  • I already have a specific rule for /system/health and it's not working. I'm only did the global allow everything once the specific rule is not working.

Avatar

Correct answer by
Level 6

@jayv25585659 My bad; I meant to send the LogLevel with `Debug`. If you want, you can go with `Trace2` to get more detailed logging on why it is blocked. Tail this log file `tail -f /var/log/httpd/dispatcher.log` and check what is happening. Here are a few things you can focus on to debug: 

  1. Is the request logged in dispatcher.log? 
  2. Is the path logged in the dispatcher the path you're requesting? Or is it being rewritten by the rewrite engine and forwarded to the dispatcher? 
  3. What is the passthrough path hitting publish instance? 

Avatar

Employee Advisor

@jayv25585659 the log should be set to debug. Make a request and capture the error and share it here.