Request mapping

The proxy server uses request mapping to match an HTTP request that is received to an application that is deployed in the cell or routing rule.

Unlike the Apache Web Server or Caching Proxy, which have flat configuration files with routing precedence that is inherent to the ordering of directives, the proxy server uses a best match mechanism to determine the installed application or routing rule that corresponds to a request. The virtual host or URI patterns determine the best match for a web module or routing rule. For applications that are deployed in clusters, the proxy server maintains affinity (Secure Sockets Layer ID, cookie, and URL rewriting), otherwise, a weighted round-robin approach is used to select the target server. The following examples address various routing scenarios for when routing rules and applications are deployed within the same cell.

Proxy environment

A WebSphere® proxy server called proxy1 is active in the same cell as the applications and routing rules. All of the applications and routing rules are enabled in the cell for proxy1, and PROXY_HTTP_ADDRESS for proxy1 is set to 80.

Virtual host Host name Port
default_host host1.company.com 80
  host1.company.com 9080
  * 80
proxy_host host2.company.com 80
  * 443
  * 80
server_host host3.company.com 80
URI group name URI patterns
ALL /*
ROOMS /kitchen/*, /bathroom/*, /bedroom/*
CONFLICT /WM2C/*
Generic server cluster name Protocol Host Port
CLUSTER1 HTTP webserver1.company.com 9081
    webserver2.company.com 9083
CLUSTER2 HTTP host47.company.com 8088
    host48.company.com 8088
CLUSTER2-SSL HTTPS host47.company.com 8443
    host48.company.com 8443
Routing rule name Virtual host URI group Action
ALLTOCLUSTER1 proxy_host ALL Generic server cluster - CLUSTER1
ROOMTOCLUSTER2 proxy_host ROOMS Generic server cluster - CLUSTER2
ALLTOCLUSTER2 server_host ALL Generic server cluster - CLUSTER2
REDIRECTTOCONFLICT default_host CONFLICT Redirect - http://www.conflict.com
Application name Context root Web module name Virtual host Web module URI patterns
App1 /WM1A/ Web Mod A default_host wm1a.jsp
  /WM1B/ Web Mod B default_host wm1b.jsp
App2 /WM2C/ Web Mod C default_host /*, wm2c.jsp
  /WM2D/ Web Mod D default_host /*, wm2d.jsp
Example 1: Basic request
The proxy1 proxy receives the following request:
GET /WM1A/wm1a.jsp HTTP/1.1 
Host: host1.company.com

The result is the wm1a.jsp file is sent as the response. The ALLTOCLUSTER1 routing rule is a possible match, but Web Mod A is chosen as the best match by proxy1 because the combination of its context root and URI pattern /WM1A/wm1a.jsp is a better match than /*. Web Mod A is also chosen as the best match because its virtual host contains the host1.company.com:80 alias, which is a more specific match than the *:80 wild card alias.

Example 2: Routing rules that use the same URI group and different virtual hosts
The proxy1 proxy receives the following request:
GET /index.html HTTP/1.1 
Host: host3.company.com

The result is the proxy1 proxy maps the request to the ALLTOCLUSTER2 routing rule, and a response is received from a server in CLUSTER2. The ALLTOCLUSTER1 routing rule is a possible match and can handle the request if the ALLTOCLUSTER2 routing rule did not exist. However, the ALLTOCLUSTER2 rule is the best match because its virtual host (server_host) explicitly lists host3.company.com.

Example 3: Routing rules that use same virtual host and different URI groups
The proxy1 proxy receives the following request:
GET /kitchen/sink.gif HTTP/1.1 
Host: host2.company.com

The result is the proxy1 proxy maps the request to the ROOMSTOCLUSTER2 routing rule and a server from the CLUSTER2 cluster sends a response. The ALLTOCLUSTER1 routing rule is a possible match, but the ROOMSTOCLUSTER2 rule is the best match because its URI group contains a pattern /kitchen/* that is a better match for the request URI /kitchen/sink.gif.

Example 4: Routing rule URI group conflicts with URI pattern of a web module that uses the same virtual host
The proxy1 proxy receives the following request:
GET /WM2C/index.html HTTP/1.1 
Host: host1.company.com

The result is indeterminate. It is unknown whether Web Mod C or the REDIRECTTOCONFLICT routing rule handles the request because they use the same virtual host and have the same URI pattern. In such cases, the ID DWCT0007E message is displayed in SystemOut.log file for the proxy1 proxy. In this example, changing the REDIRECTTOCONFLICT routing rule to use a different virtual host resolves the problem.

Note: 이 주제는 하나 이상의 애플리케이션 서버 로그 파일을 참조합니다. 권장되는 대안은 분배 및 IBM® i 시스템에서 SystemOut.log, SystemErr.log, trace.logactivity.log 파일을 사용하는 대신 HPEL(High Performance Extensible Logging) 로그를 사용하고 인프라를 추적하도록 서버를 구성하는 것입니다. 원시 z/OS® 로깅 기능과 연계하여 HPEL을 사용할 수도 있습니다. HPEL을 사용하는 경우 서버 프로파일 바이너리 디렉토리의 LogViewer 명령행 도구를 사용하여 모든 로그에 액세스하고 정보를 추적할 수 있습니다. HPEL 사용에 대한 자세한 정보는 HPEL을 사용한 애플리케이션 문제점 해결 정보를 참조하십시오.
Example 5: The PROXY_HTTP_ADDRESS address is not in the virtual host
Assume that the proxy1 proxy address, PROXY_HTTP_ADDRESS, is changed to 81, while all of the other configuration information remains the same. The proxy1 proxy receives the following request:
GET /index.html HTTP/1.1 
Host: host1.company.com:81

The result is the proxy1 proxy is unable to handle the request because the PROXY_HTTP_ADDRESS address is not available in a virtual host and will send an HTTP 404 response back to the client.


주제 유형을 표시하는 아이콘 개념 주제



시간소인 아이콘 마지막 업데이트 날짜: July 9, 2016 6:05
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=cjpx_reqmap
파일 이름:cjpx_reqmap.html