Perform the following steps to configure reverse proxy in CLI mode. You will create a configuration config1 and an instance rp as reverse proxy.
Start the Administration Server:
$ <install-dir>/admin-server/bin/startserv
Invoke the CLI shell:
<install-dir>/admin-server/bin/wadm -user <username>
You can see the wadm shell
Create config1:
wadm>create-config --http-port=8080 --server-name=config1 --server-user=root config1
Create an instance for the config1 configuration:
wadm>create-instance --config=config1 <host-name>
Add the web application on the created configuration:
wadm>add-webapp --config=config1 -vs=config1 --uri/test <warfile>
Deploy the web application.
wadm>deploy-config --user=admin --password-file=admin.pwd --host=serverhost --port=8989 config1
Create a rp configuration:
wadm>create-config --http-port=8081 --server-name=rp --server-user=root rp
Enable the rp configuration to reverse proxy using the following command:
wadm> create-reverse-proxy --user=admin --password-file=admin.pwd --host=serverhost --config=rp --vs=rp --uri-prefix=// --server=http://rick.india.sun.com:8080 |
To redirect to a secure
site, follow the same step and provide the https
address
for the --server
option.
See CLI Reference, create-reverse-proxy(1).
Create an instance for the rp configuration.
wadm>create-instance --config=rp <host-name>
Start the instances:
wadm>start-instance --config=config1 <host-name>
wadm>start-instance --config=rp <hostname>
The web application deployed in config1 can be viewed through rp instance.
http://<rp instance hostname>:8081/test
See CLI Reference, list-reverse-proxy-uris(1), set-reverse-proxy-prop(1), get-reverse-proxy-prop(1), forward-reverse-proxy-header(1), block-reverse-proxy-header(1), and list-reverse-proxy-headers(1)