The Reverse Proxy plug-in should be initialized in the Sun Java System Web Server magnus.conf file and configured in the corresponding obj.conf file.
This section includes the following topics:
</path/to/sharedobject> is the path where the shared object is installed, including the shared object itself.
Note that the path elements are “/” regardless of the operating system.
Init fn="load-modules" shlib="</path/to/sharedobject> |
Configuration of the obj.conf will vary depending on the intended use. See the Sun Java System Web Server documentation for use and syntax of the obj.conf.
This configuration will proxy the URI “/example” if it does not exist locally. A local copy of “/example” is preferred to a remote copy:
<Object name="default"> # Assign the URI "/example" (and any more specific URIs; # /example/foo.html, /example/qwe.jsp, etc) the object name # "server.example.com" NameTrans fn="assign-name" from="/example(|/*)" name="server.example.com" ... </Object> # Execute these instructions for any resource with the assigned name # "server.example.com" <Object name="server.example.com"> # Check to see if a local copy of the requested resource exists. Only # proxy the request if there is not a local copy. ObjectType fn="check-passthrough" type="magnus-internal/passthrough" # Proxy the requested resource to the URL # "http://server.example.com:8080" only if the "type" has been set to # "magnus-internal-passthrough" Service type="magnus-internal/passthrough" fn="service-passthrough" servers="http://server.example.com:8080" </Object> |
This configuration will proxy all requests for the URI “/app” without first checking for a local version. The Reverse Proxy plug-in provides its own credentials through Basic-Auth to the origin server.
<Object name="default"> # Assign the URI "/app" (and any more specific URIs; # /app/foo.html, /app/qwe.jsp, etc) the object name # "server.example.com" NameTrans fn="assign-name" from="/app(|/*)" name="server.example.com" ... </Object> # Execute these instructions for any resource with the assigned name # "server.example.com" <Object name="server.example.com"> # Proxy the requested resource to the URL # "http://server.example.com:8080" Service fn="service-passthrough" servers="http://server.example.com:8080" user="blues" password="j4ke&elwOOd " </Object> |