Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
litespeed_wiki:lslb:context_proxy [2018/11/13 16:01] Lisa Clarke Proofreading and Rewording |
litespeed_wiki:lslb:context_proxy [2021/01/09 01:49] qtwrk |
||
---|---|---|---|
Line 86: | Line 86: | ||
{{:litespeed_wiki:lslb:adc-context-10.png|}} | {{:litespeed_wiki:lslb:adc-context-10.png|}} | ||
+ | |||
+ | |||
+ | =====Context Proxy To Different Domain/URLs:===== | ||
+ | |||
+ | in this example , we will proxy context URL https://test.example.com/litespeed/ to https://different.domain.com/litespeed2/ | ||
+ | |||
+ | ====Step 1:===== | ||
+ | |||
+ | This step will be exact same as above | ||
+ | |||
+ | ====Step 2:===== | ||
+ | |||
+ | Create a new cluster if the `different.domain.com` is on different backend server, this step can be ignored if the targeted domain is on same cluster. | ||
+ | |||
+ | ====Step 3:===== | ||
+ | |||
+ | Create a new context | ||
+ | |||
+ | **URI** to ''/litespeed/'' | ||
+ | |||
+ | **Cluster** to ''back-end'' as above , or newly created cluster in step 2 | ||
+ | |||
+ | **Enable Rewrite** to ''Yes'' | ||
+ | |||
+ | **Rewrite Base** to ''/'' , this setting is required , in order to prevent the rewrite rule messes up with base. | ||
+ | |||
+ | **Rewrite Rules** as follow: | ||
+ | |||
+ | <code> | ||
+ | RewriteCond %{REQUEST_URI} !litespeed2 [NC] | ||
+ | RewriteRule "(.*)" "litespeed2/$1" [L,E=Proxy-Host:different.domain.com] | ||
+ | </code> | ||
+ | |||
+ | ''E=Proxy-Host'' flag is needed if backend is served on different domain. | ||
+ | |||
+ | ====Step 4:===== | ||
+ | |||
+ | This step can be omitted as listener is already mapped | ||
+ | |||
+ | ====Step 5:===== | ||
+ | |||
+ | Now visit ''<nowiki>https://test.example.com/litespeed/</nowiki>'' , it will serve the content from ''<nowiki>https://different.domain.com/litespeed2/</nowiki>'' |