Open Xunnamius opened 1 year ago
Seems like the most popular guidance on the internet about proxying via mod_rewrite is outdated? Seems like litespeed devs are recommending we use mod_proxy directly now. Does that apply to openlitespeed too?
Answer: no. Seems like the docs for LS and OLS that are scattered about the internet are mixed together. LS supports ProxyPass, OLS does not.
After playing around with OLS a bit and testing the limits of its capabilities, it seems like OLS is not feature-rich/mature enough to be a decent reverse proxy. Luckily, I come from the land of Nginx and have extensive experience with it.
My personal CP fork will make use of both OLS and Nginx, leveraging nginx's open source amazingness to fill in the gaps where OLS falls short. Essentially, anything outside of executing PHP sites will be handled by Nginx. That starts with reverse proxying.
See https://github.com/Xunnamius/supreme.xunn.io/issues/31 for details on Nginx + OLS.
Note: take inspiration from nginx-proxy-manager's simple UX.
My personal CP fork will make use of both OLS and Nginx, leveraging nginx's open source amazingness to fill in the gaps where OLS falls short. Essentially, anything outside of executing PHP sites will be handled by Nginx. That starts with reverse proxying.
Note: take inspiration from nginx-proxy-manager's simple UX.
@Xunnamius Do you know of simple to follow instructions for noobs like myself on how to do so? I'd love to put the Nginx proxy manager in front of my OLS as the reseverse proxy seems a lot easy with this and running into issues with docker using OLS as reserve proxy.
Hey, @zenminimalist. Maybe I should start a blog! I do my Nginx configs by hand rather than use nginx-proxy-manager, but from what I've been told it seems like it should generate configs similar in intent to mine.
If you'd like, I can show you some examples of my nginx configs for passing some traffic through to OLS, and how I configured OLS/CP to accept it. It isn't too involved, and if nginx-proxy-manager is as thin an abstraction as I've been lead to believe, it should be a short leap from nginx config file to nginx-proxy-manager config UI :)
Small warning: a small issue I encountered with CP is that it tries to recreate OLS listeners on port 80 and 443 upon restart, which conflicts with nginx. I patched this behavior out, but I haven't pushed changes to this repo just yet. You can also just go into the OLS control panel and delete them whenever you restart CP.
Right now, setting up reverse proxies is ugly (you need to drop to litespeed's control panel to update external apps configuration) and wasteful (extra users, home dirs, semi-complex PHP LSAPI configurations, various boilerplate files, etc are all created and initialized when they will never be used because every possible URL for the virtual host is proxied/redirected to somewhere else).This is eminently fixable and will dramatically improve the UX around this common devops use case.Update: OLS/CP shall not be used for reverse proxying or anything else other than executing PHP at "light speed". For everything else, there's Nginx.
Additionally, it should be easier than it is currently to switch CP's web interface to a different port. At time of writing, I meant port 80/443. But now I mean 9080. Changing it from within CP's UI works pretty well already, so perhaps this is a non-issue.
See also: https://github.com/Xunnamius/supreme.xunn.io/issues/4