NewsCrawler.org

WebLogic to Tomcat migration: rebuilding proxy integration with IIS/ARR and RemoteIpValve

WebLogicからTomcatへの移行検証 ― IIS/ARRとRemoteIpValveでプロキシ連携を再構成する
Image: zenn.dev

A migration from Oracle WebLogic Server to Apache Tomcat began as a straightforward-looking swap: the Oracle WebLogic Server Proxy Plug-In would be replaced with Application Request Routing (ARR)[1] on IIS, which forwards requests to Tomcat, using the IIS URL Rewrite Module for the forwarding rules. The problem surfaced after the point of TLS termination[2]: the Load Balancer ends the client's HTTPS connection, so Tomcat receives plain HTTP and an application on Tomcat cannot, unchanged, tell that the original access was HTTPS. WebLogic had covered this through plug-in parameters: WLProxySSL makes the Location header returned by WebLogic Server use HTTPS even when the plug-in-to-server link is HTTP, and WLProxySSLPassThrough carries the WL-Proxy-SSL header information through when a Load Balancer is the TLS endpoint.

Similar cases existed — for example, fixing request.getScheme() returning HTTP for Tomcat under IIS/ARR by setting X-Forwarded-Proto[3] and adding RemoteIpValve[4] — but the author found no public case that covered a migration from a WebLogic Proxy Plug-In setup with the HTTPS handover worked out end to end. So instead of mapping settings one to one, the old configuration was broken down by role into three parts: passing the original HTTPS information downstream, forwarding requests to Tomcat, and reflecting that information into the Servlet Request. In the new design, a trusted front stage — the Load Balancer — strips any client-supplied X-Forwarded-Proto value and sets it itself according to the real client connection; IIS/ARR forwards requests to Tomcat, with the sample URL Rewrite rule rewriting to http://127.0.0.1:8080/{R:1}; and Tomcat's RemoteIpValve reads the header and rewrites the request's scheme, secure attribute and serverPort. The sample RemoteIpValve configuration trusts only 127.0.0.1 via internalProxies — which does not itself block connections to Tomcat — and sets httpsServerPort to 443; the author warns against trusting all sources with .* and against passing untrusted X-Forwarded-For values downstream, which RemoteIpValve reads by default.

Verification looked at what the application actually sees — request.getScheme(), request.isSecure(), request.getServerPort() and the X-Forwarded-Proto header — in three stages, separating faults into header creation, proxy forwarding and Tomcat's interpretation. One debugging detour: a full URL entered in the Path field of an Apache JMeter HTTP Request overrides the Server, Port and Protocol fields, so test requests can go somewhere other than intended. The closing lesson is to migrate roles, not settings; other behavioral differences found during the work — Cookie interpretation and JSESSIONID issuance timing — were left out of scope for a separate write-up.

Read the original zenn.dev

Sources

  • Zenn JA

    WebLogicからTomcatへの移行検証 ― IIS/ARRとRemoteIpValveでプロキシ連携を再構成する

    29 likes0 bookmarks0 comments

Published: First seen: Читать по-русски

Open as a page