Ive been looking in to sogo httpd configuration so fa so good have a basic template to work with.
Just that default-virtualhost.inc is a complete mystery to me, not strange having barely basic knowledge of this stuff. IMHO it is does nothing… where are the the variables such as hostname %{HTTP_HOST} and servername (%{SERVER_NAME} “declared”.
What is the supposed use of default-virtualhost.inc? Take SOGo DAV as an example, if http://domain/dav should point at https://domain/SGOo/dav. Is this something you do with a rewrite rule in there?
EDIT: read #5088none of the test cases work
Tagged it as bug. EDIT 2: Got it, in the existing nethservers-sogo package there are some un-needed ESC- characters
Re-Tgged it as development
Yes that exactly what i mean, for dav and (dav)iOS support we need some re directions to /SOGo/dav.
AFAIK, this can be done with a rewrite rules in default-virtualhost.inc, or proxypasses in the httpd SOGo.conf (This was the “old” used method).
I would prefer the first; right now it does not work for me;
Could you try:
TEST CASE
upgrade nethserver-httpd package
server-manager redirect: http://<IP>/server-manager/ redirects to https://<IP>:980/
In the rewrite rule, what is the difference between %{SERVER_NAME} and %{HTTP_HOST} , my hunch is the later is used for virtual domains; the first redirects to the default domain
Is it oke to put the “DAV” rewrite rules in default-virtualhost.inc, i think we need about 5 of those.
@giacomo think I almost got it, no need to deliver a working package…
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/dav(/.*)?$ https://%{HTTP_HOST}/SOGo/dav$1 [R=301,L]
http://domain/dav get redirected to httpS://domain/SOGo/dav and auto discovery works
but httpS://domain/dav is not redirected to httpS://domain/SOGo/dav
Are you sure that http 301 redirect response is accepted by all clients out there?
Apache config is tricky: mod_rewrite and the core modules, like mod_proxy do not fit well together! However mod_rewrite has proxypass features too…
This is the tricky part… Port 443 has a VirtualHost section (defined by mod_ssl.conf) where mod_rewrite does not inherit the settings from the global Server scope
I’d try without mod_rewrite, by giving a try to RedirectMatch. On Apache 2.4 we have also IF blocks!