Skip to content

Instantly share code, notes, and snippets.

@pbarabe
Last active June 23, 2023 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbarabe/ff57b4a93a8f20dcf28ed6ae738984fc to your computer and use it in GitHub Desktop.
Save pbarabe/ff57b4a93a8f20dcf28ed6ae738984fc to your computer and use it in GitHub Desktop.
WebOps: Apache httpd mod_proxy configuration for pantheon.io Drupal sites
#
# 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