0

I am using an App Search instance and a node.js user interface based on an Elastic SearchUi example. I am reverse proxying the node.js app and the connection to the App Search API with Apache2. I cannot get this to work. I get the error message: An unexpected error occurred: Cannot read property 'forEach' of undefined I think this means that the search payload is not getting through but I am not 100% positive.

The relevant bit of my reverse proxy config is:

    SSLProxyEngine          On
    ProxyRequests           Off
    ProxyPreserveHost       On
    ProxyVia                Full

    Header always set Access-Control-Allow-Origin "*"
    Header always set Access-Control-Allow-Credentials false
    Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS"
    Header always set Access-Control-Allow-Headers "Accept, authorization, content-type, Host, Origin, x-swiftype-client, x-swiftype-client-version, x-swiftype-integration, x-swiftype-integration-version"

    # Added a rewrite to respond with a 200 SUCCESS on every OPTIONS request.
    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} OPTIONS
    RewriteRule ^(.*)$ $1 [R=200,L]

    ProxyPass           /    https://127.0.0.1:5000/
    ProxyPass           /api/    https://127.0.0.1:3200/
    ProxyPassReverse    /    https://127.0.0.1:5000/
    ProxyPassReverse    /api/    https://127.0.0.1:3200/

Thanx in advance for any suggestions

1 Answers1

0

The problem was the order of the ProxyPass/Reverse statements.