Dispatcher Filter Configuration
Hello,
Well, I need to configure dispatcher so I can access a get servlet I've created. It works in author and publish instances. I've also already configured the dispatcher to run on port 8080 using docker and I'm able to access published content via port 8080. Nevertheless, when I try to access my servlet via this link: localhost:8080/bin/random-number it gives me this page with a 404 not found error when I check the browser console: 
The linux command I'm using to run dispatcher on my project directory through docker is
sudo ~/aem-sdk/dispatcher/dispatcher-sdk-2.0.174/bin/docker_run.sh /home/webjump/estágio/trilha-04/aem-wknd-3.2.0/dispatcher/src host.docker.internal:4503 8080
My dispatcher filter configuration files are
1 - default_filters.any:
#
# This is the default filter ACL specifying what requests are handled by the dispatcher.
#
# DO NOT EDIT this file, your changes will have no impact on your deployment.
#
# Instead modify filters.any.
#
# deny everything and allow specific entries
# Start with everything blocked as a safeguard and open things customers need and what's safe OOTB
/0001 { /type "deny" /url "*" }
# Open consoles if this isn't a production environment by uncommenting the next few lines
# /002 { /type "allow" /url "/crx/*" } # allow content repository
# /003 { /type "allow" /url "/system/*" } # allow OSGi console
# allow non-public content directories if this isn't a production environment by uncommenting the next few lines
# /004 { /type "allow" /url "/apps/*" } # allow apps access
/005 { /type "allow" /url "/bin/*" } # allow bin path access
# Allow specific URLs
/006-allow-random-number { /type "allow" /url "/bin/random-number" }
# This rule allows content to be access
/0010 { /type "allow" /extension '(css|eot|gif|ico|jpeg|jpg|js|gif|pdf|png|svg|swf|ttf|woff|woff2|html|mp4|mov|m4v)' /path "/content/*" } # disable this rule to allow mapped content only
# Enable specific mime types in non-public content directories
/0011 { /type "allow" /method "GET" /extension '(css|eot|gif|ico|jpeg|jpg|js|gif|png|svg|swf|ttf|woff|woff2)' }
# Enable clientlibs proxy servlet
/0012 { /type "allow" /method "GET" /url "/etc.clientlibs/*" }
# Enable basic features
/0013 { /type "allow" /method "GET" /url '/libs/granite/csrf/token.json' /extension 'json' } # AEM provides a framework aimed at preventing Cross-Site Request Forgery attacks
/0014 { /type "allow" /method "POST" /url "/content/*.form.html" } # allow POSTs to form selectors under content
/0015 { /type "allow" /method "GET" /path "/libs/cq/personalization" } # enable personalization
/0016 { /type "allow" /method "POST" /path "/content/*.commerce.cart.json" } # allow POSTs to update the shopping cart
# Deny content grabbing for greedy queries and prevent un-intended self DOS attacks
/0017 { /type "deny" /selectors '(feed|rss|pages|languages|blueprint|infinity|tidy|sysview|docview|query|[0-9-]+|jcr:content)' /extension '(json|xml|html|feed)' }
# Deny authoring query params
/0018 { /type "deny" /method "GET" /query "debug=*" }
/0019 { /type "deny" /method "GET" /query "wcmmode=*" }
# Allow current user
/0020 { /type "allow" /url "/libs/granite/security/currentuser.json" }
# Allow index page
/0030 { /type "allow" /url "/index.html" }
# Allow IMS Authentication
/0031 { /type "allow" /method "GET" /url "/callback/j_security_check" }
# AEM Forms specific filters
# to allow AF specific endpoints for prefill, submit and sign
/0032 { /type "allow" /path "/content/forms/af/*" /method "POST" /selectors '(submit|internalsubmit|agreement|signSubmit|prefilldata|save|analyticsconfigparser)' /extension '(jsp|json)' }
# to allow AF specific endpoints for thank you page
/0033 { /type "allow" /path "/content/forms/af/*" /method "GET" /selectors '(guideThankYouPage|guideAsyncThankYouPage)' /extension '(html)'}
# to allow AF specific endpoints for lazy loading
/0034 { /type "allow" /path "/content/forms/af/*" /method "GET" /extension '(jsonhtmlemitter)'}
# to allow fp related functionalities
/0035 { /type "allow" /path "/content/forms/*" /selectors '(fp|attach|draft|dor|api)' /extension '(html|jsp|json|pdf)' }
# to allow forms access via dam path
/0036 { /type "allow" /path "/content/dam/formsanddocuments/**/jcr:content" /method "GET"}
# to allow invoke service functionality (FDM)
/0037 { /type "allow" /path "/content/forms/*" /selectors '(af)' /extension '(dermis)' }
# to allow forms portal draft and submissions component operation servlet
/0038 { /type "allow" /path "/content/*" /method "GET" /selectors '(fp)' /extension '(operation)' }
# AEM Screens Filters
# to allow AEM Screens channels selectors
/0050 { /type "allow" /method "GET" /url "/screens/channels.json" }
# to allow AEM Screens Content and selectors
/0051 { /type "allow" /method '(GET|HEAD)' /url "/content/screens/*" }
# AEM Sites Filters
# to allow site30 theme servlet
/0052 { /type "allow" /extension "theme" /path "/content/*" }
# Allow manifest.webmanifest files located in the content
/0053 { /type "allow" /extension "webmanifest" /path "/content/*/manifest" }
# Allow Apache Sling Sitemap selectors: sitemap, sitemap-index, sitemap.any-nested-or-named-sitemap
/0054 { /type "allow" /method "GET" /path "/content/*" /selectors 'sitemap(-index)?' /extension "xml" }
# Allow GraphQL & preflight requests
# GraphQL also supports "GET" requests, if you intend to use "GET" add a rule in filters.any
/0060 { /type "allow" /method '(POST|OPTIONS)' /url "/content/_cq_graphql/*/endpoint.json" }
# GraphQL Persisted Queries & preflight requests
/0061 { /type "allow" /method '(GET|POST|OPTIONS)' /url "/graphql/execute.json*" }
# Allow Forms Document Services requests
/0062 { /type "allow" /method '(GET|POST)' /url "/adobe/forms/*" }
2 - filters.any
#
# This file contains the filter ACL, and can be customized.
#
# By default, it includes the default filter ACL.
#
$include "./default_filters.any"
# allow non-public content directories if this isn't a production environment by uncommenting the next few lines
/005 { /type "allow" /url "/bin/*" } # allow bin path access
# Allow specific URLs
/006-allow-random-number { /type "allow" /url "/bin/random-number" }
# Allow components JSON model
/0101 { /type "allow" /extension "json" /selectors "model" /path "/content/*" }
# Allow manifest.webmanifest files located in the content
/0102 { /type "allow" /extension "webmanifest" /path "/content/*/manifest" }
# Allow Quick Search
/0110 { /type "allow" /extension "json" /selectors "searchresults" /path "/content/*" }
# Allow j_security check for login
/0111 { /type "allow" /method "POST" /url "/system/sling/login/j_security_check" }
#Allow logout path
/0112 { /type "allow" /method "POST" /url "/system/sling/logout" }
# Allow GraphQL global endpoint & preflight requests
# GraphQL also supports GET requests, if you intend to use GET include it in the rule below
/0164 { /type "allow" /method '(POST|OPTIONS)' /url "/content/graphql/global/endpoint.json" /extension "json"}
/0165 { /type "allow" /method '(POST|OPTIONS)' /url "/content/cq:graphql/wknd/endpoint.json" /extension "json"}
# GraphQL Persisted Queries
/0170 { /type "allow" /method '(POST|OPTIONS)' /url "/graphql/execute.json/*" }
/0171 { /type "allow" /url "/graphql/execute.json/*" }
# Allow to download web manifest for PWA
/0180 { /type "allow" /extension "webmanifest" }
# ContextHub
/0200 { /type "allow" /url "*/contexthub.pagedata.json" }
/0201 { /type "allow" /url "/home/users/*.infinity.json" }
What am I missing? Are there any other files that I need to alter? How can I know where is the problem?
Update: this is what I'm getting with the debug mode
[Tue Nov 28 15:01:00.932224 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:33972] Found farm publishfarm for localhost:8080
[Tue Nov 28 15:01:00.932247 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:33972] checking [/bin/random-number]
[Tue Nov 28 15:01:00.932258 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:33972] request URL has no extension: /bin/random-number
[Tue Nov 28 15:01:00.932262 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:33972] cache-action for [/bin/random-number]: NONE
[Tue Nov 28 15:01:00.932313 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:33972] Filter rejects: GET /bin/random-number HTTP/1.1
[Tue Nov 28 15:01:00.932502 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:0] Found farm publishfarm for localhost:8080
[Tue Nov 28 15:01:00.932513 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:0] checking [/content/wknd/us/en/errors/404.html]
[Tue Nov 28 15:01:00.932551 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:0] never flushed [/mnt/var/www/html/content/wknd/.stat] -> use cache [/mnt/var/www/html/content/wknd/us/en/errors/404.html]
[Tue Nov 28 15:01:00.932564 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:0] cache-action for [/content/wknd/us/en/errors/404.html]: DELIVER
[Tue Nov 28 15:01:00.932568 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:0] request declined
[Tue Nov 28 15:01:00.932893 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:0] response.headers[Content-Type] = "text/html;charset=utf-8"
[Tue Nov 28 15:01:00.932906 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:0] response.headers[X-Content-Type-Options] = "nosniff"
[Tue Nov 28 15:01:00.932921 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:0] response.headers[Age] = "2937875"
[Tue Nov 28 15:01:01.002473 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:33972] Found farm publishfarm for localhost:8080, referer: http://localhost:8080/bin/random-number
[Tue Nov 28 15:01:01.002487 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:33972] checking [/etc/cloudsettings.kernel.js/conf/wknd/settings/cloudsettings/default/contexthub], referer: http://localhost:8080/bin/random-number
[Tue Nov 28 15:01:01.002492 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:33972] request URL has no extension: /etc/cloudsettings.kernel.js/conf/wknd/settings/cloudsettings/default/contexthub, referer: http://localhost:8080/bin/random-number
[Tue Nov 28 15:01:01.002496 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:33972] cache-action for [/etc/cloudsettings.kernel.js/conf/wknd/settings/cloudsettings/default/contexthub]: NONE, referer: http://localhost:8080/bin/random-number
[Tue Nov 28 15:01:01.002626 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:33972] Creating new connection: 192.168.0.11:4503, referer: http://localhost:8080/bin/random-number
[Tue Nov 28 15:01:01.002759 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:33972] Connected to backend 0 (192.168.0.11:4503), referer: http://localhost:8080/bin/random-number
[Tue Nov 28 15:01:01.039008 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:33972] response.status = 200, referer: http://localhost:8080/bin/random-number
[Tue Nov 28 15:01:01.039029 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:33972] response.headers[Date] = "Tue, 28 Nov 2023 15:01:01 GMT", referer: http://localhost:8080/bin/random-number
[Tue Nov 28 15:01:01.039036 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:33972] response.headers[X-Content-Type-Options] = "nosniff", referer: http://localhost:8080/bin/random-number
[Tue Nov 28 15:01:01.039041 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:33972] response.headers[X-Frame-Options] = "SAMEORIGIN", referer: http://localhost:8080/bin/random-number
[Tue Nov 28 15:01:01.039046 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:33972] response.headers[ETag] = ""67400b98d9aa58b9970dc399607ec85102e979a6"", referer: http://localhost:8080/bin/random-number
[Tue Nov 28 15:01:01.039051 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:33972] response.headers[Content-Type] = "application/javascript; charset=utf-8", referer: http://localhost:8080/bin/random-number
[Tue Nov 28 15:01:01.049161 2023] [dispatcher:debug] [pid 313:tid 139849276103480] [client localhost:33972] No socket reuse: backend asks to close connection, referer: http://localhost:8080/bin/random-number
Now I can see that the filter is rejecting the request, even though I've modified filters.any to allow it. Did I modify the wrong file? Is the syntax wrong? Is it missing something?

