RealObjects Nimbudocs Editor 2.5.3885_Beta5

Guide: Reverse Proxy


In most cases Nimbudocs Editor will be integrated into a governing web application. However, the server which serves the wep application is not necessarily the same server that hosts Nimbudocs Editor. This is a common scenario and has the following implications for the user: The browser will make requests from the web application site to the Nimbudocs Editor server. Since these are two different servers, the browser has to do cross-origin resource sharing (CORS) to access the Nimbudocs Editor server.


Cross-origin resource sharing is a means for the browser to request resources from another domain different from the current web site. If the user's browser supports CORS and allows for cross-origin XMLHttpRequests, this will work just fine since the Nimbudocs Editor server automatically sets appropriate headers to allow for CORS.

Reverse Proxy

CORS can only be used if the browser supports and allows it. Additionally, in some integration scenarios it may be desirable to control the connections made by the Nimbudocs Editor from the client to the Nimbudocs Editor server by tunneling all requests from the editor through the server of the integrating web application. This can be achieved by configuring a "reverse proxy".

Assuming your web application runs on the server and Nimbudocs Editor runs on another server If you want the clients not to make any requests to directly, you can use a reverse proxy to tunnel all of the clients' requests through your web application server. So when setting up the reverse proxy you could configure it in a way that all requests made to will be forwarded to by the reverse proxy, eliminating the need for the clients to contact directly.

The following examples show how to setup and configure a reverse proxy for different web application servers. The proxy is configred so that will forward all requests to


The following web modules are required to enable reverse proxy functionality:

LoadModule proxy_module libexec/apache2/
LoadModule proxy_http_module libexec/apache2/

And to setup the reverse proxy:

ProxyPass /nimbudocs


The following modules must be installed on the IIS to set up a reverse proxy:

To configure a reverse proxy, you have to add a rewrite rule to the web.config of your web application like this:

                <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                    <match url="nimbudocs/(.*)" />
                    <action type="Rewrite" url="{R:1}" />


When using Jetty you can write a simple reverse proxy servlet:

public class NimbudocsProxy extends ProxyServlet {
    public NimbudocsProxy() {
    protected HttpURI proxyHttpURI(HttpServletRequest request, String uri) {
        String servletContextPath = getServletConfig().getServletContext().getContextPath() + "/" + getServletConfig().getServletName();
        String nimbudocsServerUrl = "";
        String requestUri = request.getRequestURI();
        String query = request.getQueryString();
        requestUri = requestUri.substring(servletContextPath.length());
        nimbudocsServerUrl += requestUri;
        if (query != null && query.length() > 0) {
            nimbudocsServerUrl += "?" + query;
        HttpURI httpUri = new HttpURI(URI.create(nimbudocsServerUrl));
        return httpUri;

To setup the servlet, you also have to add a few entries to your web.xml:




Once the reverse proxy has been configured and set up, you have to load the Nimbudocs Editor JavasScript files from the new URL as well as change the Nimbudocs Editor server URL appropriately.

Basic Integration:

<script src=""></script>
jQuery(window).load(function() {
    NimbudocsEditor.create("nimbuContainer", "");

Integration With Reverse Proxy:

<script src=""></script>
jQuery(window).load(function() {
    NimbudocsEditor.create("nimbuContainer", "");

As you can see, when using the reverse proxy, there are now only URLs used which contain the domain of your web application, namely instead of