Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
litespeed_wiki:proxy:lsws-as-a-proxy-rewrite [2019/06/05 18:39]
Jackson Zhang [Example 3: Proxy to a site on the same server]
litespeed_wiki:proxy:lsws-as-a-proxy-rewrite [2019/06/20 19:08]
Jackson Zhang [Use rewrite rules or mod_proxy directive (currently not supported) in .htaccess]
Line 24: Line 24:
 5. After saving, restart LSWS 5. After saving, restart LSWS
  
-===== Use rewrite rules or mod_proxy directive (currently not supported) ​in .htaccess =====+===== Use rewrite rules in .htaccess =====
 ==== Example 1: Proxy to a site on the backend with the same domain name.==== ​ ==== Example 1: Proxy to a site on the backend with the same domain name.==== ​
     * In Shell or an Editor, edit the .htaccess file normally located in virtualhost document root and add the following:     * In Shell or an Editor, edit the .htaccess file normally located in virtualhost document root and add the following:
Line 56: Line 56:
 </​code>​ </​code>​
  
-==== Example 4: cpanel ​webmail like proxy ==== +==== Example 4: cPanel ​webmail-like proxy ==== 
-A user using Apache without control panel but he wants to achieve the same that is in cPanel ​for www.domain.com/​webmail: when anyone accesses webmail at www.domain.com/​webmail it will load one installation ​that loads at http://​127.0.0.1/​rainloop/​.+cPanel's ''​www.domain.com/​webmail''​ proxy loads one installation at ''<​nowiki>​http://​127.0.0.1/​rainloop/​</​nowiki>''​.
  
-With Apache ​we achieved ​it with the ''​ProxyPass'':​+An Apache ​user without a control panel who wants to copy this behavior may achieve ​it with ''​ProxyPass''​, like so:
   ProxyPass "/​webmail/"​ "​http://​127.0.0.1/​rainloop/"​   ProxyPass "/​webmail/"​ "​http://​127.0.0.1/​rainloop/"​
  
-but LiteSpeed doesn'​t support ''​ProxyPass''​ in this case. What exactly does the user need to do to achieve it with LiteSpeed? Actually using the following rewrite rule in the virtual host apache ​configuration ​should just work without creating ​external app on LSWS configuration: +But LiteSpeed doesn'​t support ''​ProxyPass''​ in this case. Instead, a LiteSpeed ​user may simply use the following rewrite rule in the virtual host's Apache ​configuration. No need to create an external app:
   RewriteRule /​webmail/​(.*) http://​127.0.0.1/​rainloop/​$1 [P]   RewriteRule /​webmail/​(.*) http://​127.0.0.1/​rainloop/​$1 [P]
- 
- 
  
 ===== Testing ===== ===== Testing =====
  • Admin
  • Last modified: 2021/08/09 14:00
  • by Jackson Zhang