I am running my web app at abc.com
with apache as the web server.
I have some static pages hosted on SquareSpace... eg. abc.squarespace.com/landing
I want to configure apache to serve content from abc.squarespace.com
when it get's a request for abc.com/landing
I've done this in nginx by using proxy_pass with the backend as abc.squarespace.com
for location /landing
. But I'm not sure how to do this in Apache. No luck doing research on the web as well.
Thanks in advance.
1 Answers
Answers 1
Message body cannot contain URLs with abc.com
, so I will be using example.com
and example.squarespace.com
.
I believe you are looking for frame forwarding. In order to implement it, use the following steps:
- On
example.squarespace.com
allow frame forwarding fromexample.com
by setting the appropriate HTTP headers via web server configuration:
X-Frame-Options: ALLOW-FROM https://example.com/
For detailed explanation refer to https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
- Verify that Apache mod_proxy_http is enabled at
example.com
:
# apachectl -M | grep proxy_http proxy_http_module (shared)
- Set the following rewrite rules in Apache configuration or
.htaccess
file to serve content fromhttp://example.squarespace.com/landing
<IfModule proxy_http_module> RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC] RewriteRule ^landing(.*) http://example.squarespace.com/landing [P] </IfModule>
The syntax here is the same as for Apache mod_rewrite.
0 comments:
Post a Comment