# Guide to OpenIG
Chapter 11. Configuration Templates

Sidebar | Prev | Up | Next

## 11.7. Multiple Applications

Shows how a single OpenIG configuration can proxy to multiple applications on different IPs and ports. This template is setup to proxy to both the WordPress and MediaWiki hosted samples. OpenIG must be setup to listen on both ports 8080 and 8181. The `DispatchHandler` is used to route each incoming request to either the WordPress chain or the MediaWiki chain.

    {
      "heap": {
        "objects": [
        {
            "name": "HandlerServlet",
            "type": "HandlerServlet",
            "config": {
                "handler": "DispatchHandler"
            }
        },
        {
            "name": "DispatchHandler",
            "type": "DispatchHandler",
            "config": {
                "bindings": [
                    {
                        "condition": "${exchange.request.uri.host == 'demo.forgerock.com'}",
                        "handler": "WordPressLoginChain",
                        "baseURI":"http://109.73.67.52:8080",
                    },
                    {
                        "condition": "${exchange.request.uri.host == 'demo.forgerock.com'}",
                        "handler": "MediaWikiLoginChain",
                        "baseURI":"http://109.73.67.52:8181"
                    }
                ]
            }
        },
        {
            "name": "WordPressLoginChain",
            "type": "Chain",
            "config": {
                "filters": [],
                "handler": "OutgoingChain"
            }
        },
        {
            "name": "MediaWikiLoginChain",
            "type": "Chain",
            "config": {
                "filters": [],
                "handler": "OutgoingChain"
            }
        },
        {
            "name": "OutgoingChain",
            "type": "Chain",
            "config": {
                "filters": ["CaptureFilter"],
                "handler": "ClientHandler"
            }
        },
        {
            "name": "CaptureFilter",
            "type": "CaptureFilter",
            "config": {
                "captureEntity": false,
                "file": "/tmp/gateway.log"
            }
        },
        {
            "name": "ClientHandler",
            "comment": "Responsible for sending all requests to remote servers.",
            "type": "ClientHandler",
            "config": {
            }
        }
      ]
    },
      "servletObject": "HandlerServlet",
    }