简体   繁体   English

WebSphere 反向代理插件 - 跳过域

[英]WebSphere reverse proxy plugin - skipping domains

Hoping someone can give me some advice if possible.如果可能的话,希望有人能给我一些建议。

We have a Linux box in our DMZ with the WebSphere plugin.我们的 DMZ 中有一个带有 WebSphere 插件的 Linux 机器。 This points to a Windows box running WebSphere Application Server.这指向运行 WebSphere Application Server 的 Windows 框。

httpd config only contains the default virtualhost with no ServerAlias specified. httpd 配置仅包含未指定 ServerAlias 的默认虚拟主机。 There is a redirect set up in the virtualhost in httpd.conf to forward any requests to service.domain.com to service.domain.com/wascontext1 .在 httpd.conf 中的虚拟主机中设置了重定向,以将任何对service.domain.com 的请求转发到service.domain.com/wascontext1 Plugin-cfg.xml is set up with two uri groups, wascontext1 and wascontext2 , but only 1 is actively used. Plugin-cfg.xml 设置了两个 uri 组, wascontext1wascontext2 ,但只有 1 个被主动使用。

I want to use the Linux box as a reverse proxy for another application totally separate to WAS.我想使用 Linux 机器作为另一个完全独立于 WAS 的应用程序的反向代理。 It would have a different domain (ie dimsim.domain.com ) but point to the same IP.它将具有不同的域(即dimsim.domain.com )但指向相同的 IP。

I was going to add another virtualhost for this but am unsure exactly how the WebSphere plugin will behave with it.我打算为此添加另一个虚拟主机,但我不确定 WebSphere 插件将如何处理它。 From what I understand if I set this up and went to dimsim.domain.com/wascontext1 it would serve the WebSphere content as httpd forwards all requests to the plugin.据我所知,如果我设置它并转到dimsim.domain.com/wascontext1 ,它将为WebSphere 内容提供服务,因为httpd 将所有请求转发到插件。

Is there a way to tell httpd to not send requests to the WebSphere plugin based on domain name or virtualhost?有没有办法告诉httpd不要根据域名或虚拟主机向WebSphere插件发送请求? Or would doing a rewrite on any requests to dimsim.domain.com/wascontext be considered ok?或者对dimsim.domain.com/wascontext 的任何请求进行重写是否可以?

thanks谢谢

jc jc

EDIT: Thanks for the responses!编辑:感谢您的答复! I'll test changing the virtualhost name in plugin-cfg.xml on our second unused context and let you know how it goes.我将在第二个未使用的上下文中测试更改 plugin-cfg.xml 中的虚拟主机名,并让您知道它是如何进行的。

If you look at the plugin-cfg.xml file, in the first part of the file you will find virtualhostgroup section similar to this:如果您查看plugin-cfg.xml文件,您会在文件的第一部分找到类似于以下内容的virtualhostgroup部分:

<VirtualHostGroup Name="default_host">
  <VirtualHost Name="*:9080"/>
  <VirtualHost Name="*:9443"/>
  <VirtualHost Name="*:443"/>
  <VirtualHost Name="*:80"/>
</VirtualHostGroup>

just change the Name from * to the required domain name eg service.domain.com and then plugin will forward only requests for the service.domain.com hostname.只需将Name*更改为所需的域名,例如service.domain.com ,然后插件将仅转发对service.domain.com主机名的请求。

So something like:所以像:

<VirtualHost Name="service.domain.com:80"/>

should work for you.应该为你工作。

When a request comes into the web server, it is passed to the WebSphere plugin and then plugin examines the request based on its configuration to determine if it should forward to WebSphere or pass back to the web server for further processing.当一个请求进入 Web 服务器时,它被传递到 WebSphere 插件,然后插件根据它的配置检查请求以确定它是否应该转发到 WebSphere 或传递回 Web 服务器进行进一步处理。

The "route" clauses in the plugin-cfg.xml are key to determining what will be forwarded and what will not. plugin-cfg.xml 中的“路由”子句是决定哪些内容将被转发,哪些内容不会转发的关键。 A request must match all the values in the route to be forwarded.请求必须匹配要转发的路由中的所有值。 A route contains virtual hosts, uris and clusters.路由包含虚拟主机、URI 和集群。 The request must match one a virtual host from the VirtualHostGroup in the route, a URI from the UriGroup in the route and there must be an available server in the ServerCluster value of the route for the request to be sent to WebSphere.请求必须与来自路由中 VirtualHostGroup 的虚拟主机、来自路由中 UriGroup 的 URI 相匹配,并且路由的 ServerCluster 值中必须有一个可用的服务器才能将请求发送到 WebSphere。

Note-If you manipulate your plugin-cfg.xml for your setup, be aware that plugin is very sensitive about the format of this configuration and incorrect or invalid entries could cause a crash of the webserver.注意 - 如果您操作 plugin-cfg.xml 进行设置,请注意插件对此配置的格式非常敏感,不正确或无效的条目可能会导致网络服务器崩溃。 Be sure to backup the file and test before using in production.在生产中使用之前,请务必备份文件并进行测试。 Also, if you modify your WebSphere configuration, it could overwrite this file and wipe out your changes.此外,如果您修改 WebSphere 配置,它可能会覆盖此文件并清除您的更改。

A solution that doesn't require plugin-cfg.xml changes: If you use an Apache-based HTTP server, you can conditionally set the per-request variable "skipwas" to short-circuit the WAS Plugin processing.一个不需要更改 plugin-cfg.xml 的解决方案:如果您使用基于 Apache 的 HTTP 服务器,您可以有条件地设置每个请求变量“skipwas”以短路 WAS 插件处理。

eg例如

SetEnvIf Host ^dimsim\.domain\.com$ skipwas=1

Sorry for the late response.回复晚了非常抱歉。

covener's answer of setting the following does what I need. covener 对以下设置的回答符合我的需要。

SetEnvIf Host ^dimsim\.domain\.com$ skipwas=1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM