I'm trying to replace Apache with OpenBSDs httpd but can't figure out what to do with my ProxyPass statements.
In apaches conf it looks like this
ProxyPass /someurl http://192.168.123.123/someotherurl
ProxyPassReverse /someurl http://192.168.123.123/someotherurl
- I thought I should use relayd for this, but how do I do the URL rewrite?
- Would I set up relayd to listen on port 80 and forward some things to different internal machines and the rest to httpd on localhost?
Best Answer
Great question! OpenBSD's newly written
httpd
is not a fully-featured web-server, and nor is it intended to be. As forrelayd
, which was the precursor tohttpd
, I do not believe that it has any ability to do what you require, either.The best general-purpose replacement for Apache bar none is still nginx.
It is readily available in the OpenBSD ports tree as
www/nginx
, and can be easily installed as a precompiled package withpkg_add(1)
—doas pkg_add nginx
.Once you install nginx, you would use the
proxy_pass
directive, and it'll probably look like this:As for
ProxyPassReverse
, nginx has a more appropriate name for it —proxy_redirect
, and the default value ofdefault
should already be sufficient for your needs (that is, if yourProxyPassReverse
andProxyPass
directives both had the same value). Good luck!