Re: sogo, httpd(8) and the rewrite need

2015-06-15 Thread Joel Carnat
 Le 15 juin 2015 à 01:16, Reyk Floeter r...@openbsd.org a écrit :
 
 On 14.06.2015, at 18:08, Joel Carnat j...@carnat.net wrote:
 
 Hi,
 
 I was going to install SOGo on OpenBSD 5.7 using the native httpd(8).
 In the readme, there are configuration examples for nginx and 
 apache-httpd-openbsd. Nothing for the new httpd.
 There are rewrite/redirect features that I can’t figure out how to setup 
 with httpd(8).
 
 nginx example:
   location = /principals/
   {
   rewrite ^ http://$server_name/SOGo/dav;
   allow all;
   }
 
 apache-httpd-openbsd example:
 RedirectMatch ^/principals/$ http://127.0.0.1:8800/SOGo/dav/
 
 Is it possible to achieve such feature with httpd and/or relayd ?
 
 
 Kind of. You could try something like:
 
 location /principals/ {
block return 301 http://$SERVER_NAME/SOGo/dav/;
 }
 
 Replace $SERVER_NAME with the IP, or add $SERVER_PORT, if required.

OK, thank you.

Now, part 2 ; is there a way to mimic the ProxyPass primitive ?

nginx example:
server {
  listen 80;
  location ^~/SOGo {
proxy_pass http://127.0.0.1:2;

apache-httpd-openbsd example:
  ProxyPass /SOGo http://127.0.0.1:2/SOGo
  ProxyPassReverse /SOGo http://127.0.0.1:2/SOGo

That is, the browser thinks it is talking to httpd(8) on https://public.ip:443/ 
but the daemon forwards to internal hidden process.

Thanks.



Re: sogo, httpd(8) and the rewrite need

2015-06-14 Thread Reyk Floeter
 On 14.06.2015, at 18:08, Joel Carnat j...@carnat.net wrote:
 
 Hi,
 
 I was going to install SOGo on OpenBSD 5.7 using the native httpd(8).
 In the readme, there are configuration examples for nginx and 
 apache-httpd-openbsd. Nothing for the new httpd.
 There are rewrite/redirect features that I can’t figure out how to setup with 
 httpd(8).
 
 nginx example:
location = /principals/
{
rewrite ^ http://$server_name/SOGo/dav;
allow all;
}
 
 apache-httpd-openbsd example:
 RedirectMatch ^/principals/$ http://127.0.0.1:8800/SOGo/dav/
 
 Is it possible to achieve such feature with httpd and/or relayd ?
 

Kind of. You could try something like:

location /principals/ {
block return 301 http://$SERVER_NAME/SOGo/dav/;
}

Replace $SERVER_NAME with the IP, or add $SERVER_PORT, if required.

Reyk