Skip to content

Commit

Permalink
SITES-3659 - [Odin] Review Dispatcher config for Odin and contribute …
Browse files Browse the repository at this point in the history
…generic parts - Persisted queries (#369)
  • Loading branch information
sandru85 authored Jul 12, 2022
1 parent 7e70ad6 commit edce55c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
6 changes: 3 additions & 3 deletions dispatcher/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@
</requireFileChecksum>
<requireFileChecksum>
<file>src/conf.d/dispatcher_vhost.conf</file>
<checksum>b30900e92c6995dfa6c68efcf159f4f0</checksum>
<checksum>b27855383754854932170e282fbf643a</checksum>
<type>md5</type>
<message>There have been changes detected in a file which is supposed to be immutable according to https://docs.adobe.com/content/help/en/experience-manager-cloud-service/implementing/content-delivery/disp-overview.html#file-structure: src/conf.d/dispatcher_vhost.conf</message>
</requireFileChecksum>
<requireFileChecksum>
<file>src/conf.d/rewrites/default_rewrite.rules</file>
<checksum>92800e1502954d8038b103f027cee332</checksum>
<checksum>8b866275685509537f6ab0397ddeda53</checksum>
<type>md5</type>
<message>There have been changes detected in a file which is supposed to be immutable according to https://docs.adobe.com/content/help/en/experience-manager-cloud-service/implementing/content-delivery/disp-overview.html#file-structure: src/conf.d/rewrites/default_rewrite.rules</message>
</requireFileChecksum>
Expand All @@ -83,7 +83,7 @@
</requireFileChecksum>
<requireFileChecksum>
<file>src/conf.dispatcher.d/cache/default_rules.any</file>
<checksum>daf2c7e3b81a862f5ee4f27b4c22de2f</checksum>
<checksum>bc9135f627dd2c813373950d7cb71af4</checksum>
<type>md5</type>
<message>There have been changes detected in a file which is supposed to be immutable according to https://docs.adobe.com/content/help/en/experience-manager-cloud-service/implementing/content-delivery/disp-overview.html#file-structure: src/conf.dispatcher.d/cache/default_rules.any</message>
</requireFileChecksum>
Expand Down
13 changes: 5 additions & 8 deletions dispatcher/src/conf.d/dispatcher_vhost.conf
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,6 @@ Alias "/system/probes/start" /etc/httpd/probes/startup-status.json
RewriteRule ^/(.*)$ - [R=404,L]
</LocationMatch>
</IfDefine>
<IfDefine ENVIRONMENT_STAGE>
SSLProxyEngine on
<LocationMatch "^/content/_cq_graphql/.*/endpoint.json$">
RewriteCond %{ENV:ENABLE_GRAPHQL_ENDPOINT} ^$ [OR]
RewriteCond %{ENV:ENABLE_GRAPHQL_ENDPOINT} ^false$
RewriteRule ^/(.*)$ - [R=404,L]
</LocationMatch>
</IfDefine>

# If the module loads correctly then apply base settings for the module
<IfModule disp_apache2.c>
Expand Down Expand Up @@ -116,6 +108,11 @@ Alias "/system/probes/start" /etc/httpd/probes/startup-status.json
Header unset Age
</IfDefine>

# SITES-3659 Prevent re-encodes of URLs sent to GraphQL Persisted Queries API endpoint
<LocationMatch "/graphql/execute.json/.*">
ProxyPassMatch http://${AEM_HOST}:${AEM_PORT} nocanon
</LocationMatch>

# (legacy) Allow ingressroute checks through on /systemready (regardless of dispatcher filters)
<Location "/systemready">
ProxyPass http://${AEM_HOST}:${AEM_PORT}/systemready
Expand Down
4 changes: 4 additions & 0 deletions dispatcher/src/conf.d/rewrites/default_rewrite.rules
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ RewriteRule .* - [F]

# Block wp-login
RewriteRule ^.*wp-login - [F,NC,L]

# Allow caching of persisted queries
RewriteCond %{REQUEST_URI} ^/graphql/execute.json
RewriteRule ^/(.*)$ /$1;.json [PT,L]
6 changes: 0 additions & 6 deletions dispatcher/src/conf.dispatcher.d/cache/default_rules.any
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,3 @@
/glob "/screens/channels.json"
/type "deny"
}

# GraphQL cache rules for persistent queries
/0020 {
/glob "/graphql/execute.json/*"
/type "deny"
}

0 comments on commit edce55c

Please sign in to comment.