URL rewriting

51 views
Skip to first unread message

Sachin Garg

unread,
Feb 10, 2016, 6:49:52 AM2/10/16
to membrane-monitor
Hi,

We are using URL re writer in service proxy and tried to redirect from input URL to output URL.

Our understanding is while redirection, URL on web browser will be input URL only.

but in case if we are trying to redirect to google.com then URL in browser changed to google.com which is not expected in case of Reverse proxy.

Let us know what could be the reason behind it.

Regards,
Sachin Garg


Tobias Polley

unread,
Feb 10, 2016, 7:23:12 AM2/10/16
to membrane-monitor
Hi Sachin,

by default, the request is rewritten only, if you only modify the path. You need to explicitly set the "do" attribute, as shown here:

<serviceProxy port="2000">
    <request >
        <rewriter>
            <map from="^/foo" to="/bar" do="redirect" />
        </rewriter>
    </request>
</serviceProxy>

The documentation is at http://membrane-soa.org/service-proxy-doc/4.1/configuration/reference/rewriter-map.htm .

In case of Google, I would guess they respond with a redirect themselves and Membrane passes the redirection response through to the browser, redirecting you to their other site.

Best, Tobias
Reply all
Reply to author
Forward
0 new messages