Live Preview - Proxy server integration
This page is written for the Beebox administrator.
Proxy server compatibility
Live Preview runs as a web site in Microsoft IIS. It is installed on the same server as the Beebox software.
Many users directly expose Live Preview (and/or Beebox) in the Internet. However, network and system administrators may already use a proxy server as the single gateway between the Internet and all internal systems.
Live Preview can be exposed via a proxy server without problems:
- Map a domain or sub domain to Live Preview.
- For example, map http://preview.mydomain.com to Live Preview on your Beebox server http://{Beebox server}:9100
Without using a proxy server
Simply make the IP address of the Beebox server accessible in the Internet.
For custom domains or sub domains, add CNAME to your domain name.
Optionally, install an SSL certificate to your Beebox server's IIS.
Proxy server to map custom domain
Use a proxy server to access Live Preview with a custom domain or sub domain.
Configure proxy server to map a domain nor sub domain to the Beebox server and the Live Preview port (9100).
Example:
http://preview.mydomain.com ==> http://{Beebox server}:9100
http://preview.mydomain.com/_LivePreview ==> http://{Beebox server}:9100/_LivePreview
You do not need to do anything special. It will work simply.
Proxy server with fully customized URLs
Advanced customization of Live Preview location and URL naming.
This block is for implementing advanced mappings like below:
Change _LivePreview path:
http://preview.mydomain.com ==> http://{Beebox server}:9100
http://preview.mydomain.com/preview/select ==> http://{Beebox server}:9100/_LivePreview
Add a root relative path:
http://www.mydomain.com/preview ==> http://{Beebox server}:9100
http://www.mydomain.com/preview/select ==> http://{Beebox server}:9100/_LivePreview
- Go to the web.config file of LivePreview and apply the necessary changes:
- Your reverse proxy needs to rewrite URLs. In the second case you further need to add HTTP rewrite rules in the proxy to adjust absolute URLs of type "/*" (while not rewriting //*).
The web.config proposes the parameters below. They can be commented if not used:
<add key="urlBase" value="" />
The absolute path of the root before proxy rewriting. The proxy can (if wanted) rewrite this url in the http result stream.
<add key="urlBaseLivePreview" value="" />
The absolute path of _LivePreview before proxy rewriting. The proxy can (if wanted) rewrite this url in the http result stream.
<add key="urlBaseJS" value="" />
The absolute path of the root without proxy rewriting. Used when URLs are built from JS code (no proxy rewriting possible).
<add key="urlBaseLivePreviewJS" value="" />
The absolute path of _LivePreview without proxy rewriting. Used when URLs are built from JS code (no proxy rewriting possible).
Example 1:
Proxy:
www.mydomain.com/ ==> localhost:9100/
www.mydomain.com/setup ==> localhost:9100/_LivePreview
Proxy does not need to replace urls in http.
Parameters:
- urlBaseLivePreview = urlBaseLivePreviewJS = /setup
Example 2:
Proxy:
www.mydomain.com/preview ==> localhost:9100/
www.mydomain.com/preview/setup ==> localhost:9100/_LivePreview
Proxy must replace urls "/" to "/preview" in http. Do not replace "//...." urls!
Parameters:
- urlBase = ""
- urlBaseJS = "preview"
- urlBaseLivePreview = "_LivePreview"
- urlBaseLivePreviewJS = "/preview/setup"
Gzip compression
If your proxy server does not support gzip compressed content, you can disable this.
Select the web.config file of the Live Preview IIS site, and add the <urlCompression> node as shown below:
...
<system.webServer>
...
<urlCompression doStaticCompression="false" />
...
</system.webServer>
...