Last active
June 23, 2023 15:53
-
-
Save pbarabe/ff57b4a93a8f20dcf28ed6ae738984fc to your computer and use it in GitHub Desktop.
WebOps: Apache httpd mod_proxy configuration for pantheon.io Drupal sites
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Apache VHost Confg to reverse-proxy a Drupal 9 site hosted on pantheon.io in a subdirectory path | |
# | |
<VirtualHost *:443> | |
ServerName myserver.arizona.edu | |
# [Your other usual directives here] | |
# | |
# Reverse Proxied Pantheon Site Config to serve https://myserver.arizona.edu/mywebsite | |
# | |
# This requires that both mod_proxy and mod_proxy_html be enabled | |
# | |
SSLProxyEngine On | |
Redirect /mywebsite /mywebsite/ | |
ProxyPass /mywebsite/ https://live-mywebsite.pantheonsite.io/ | |
ProxyHTMLURLMap https://live-mywebsite.pantheonsite.io /mywebsite | |
<Location /mywebsite/> | |
ProxyPassReverse / | |
ProxyHTMLEnable On | |
# ProxyHTMLExtended will allow URLs within <style> and <script> tags to be handled correctly | |
ProxyHTMLExtended On | |
ProxyHTMLDocType "<!DOCTYPE html>" | |
ProxyHTMLURLMap / /mywebsite/ [^] | |
# This next line will fix URLs for uploaded files in any inline CSS | |
ProxyHTMLURLMap /sites/ /mywebsite/sites/ | |
RequestHeader unset Accept-Encoding | |
</Location> | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment