Hello guys, I installed CWP and loving it, but got some issues with forcing https on my site so my questions are simple:
1-how to force https on all my domains without using the .htaccess file, is there any better way?
2-do i have to request a new letsencrypt SSL for each domain and subdomain i created? cant it be shared?
3-how to properly force https on roundcube webmail? lets encrypted is installed however if i typed http://webmail.domainname.com it doesnt redirect to https, so need this to be working.
thats all for now. thanks in advanced.
cheers
U need to edit the apache template and regenerate the vhosts for Server wide ssl for your Domains.
Cant give you an example howto do but maybe another Person :)
Im having trouble getting my webmail to force https as well. My webmail domain sits at mydomain.com/webmail. I have tried editing the .htaccess (works for the main domain but not the /webmail). Also edited the webmail.conf located at /usr/local/cwpsrv/conf.d/webmail.conf with the following code :
return 301 https://$host:2096$request_uri;
Nothing seems to be working. Anyone figure this out yet?
Hi,
The most practical way to force webmail to secure mode for all user accounts is to apply the nginx force-https template in WebServers Settings -> WebServers Master Conf or only for specific users in WebServers Domain Conf.
I had this HTTP to HTTPS working some days ago, But after the CWP update, I guess the configuration changes I made were reset.
I tried again to set a redirect in webmail.conf but now I get too many redirects error and certificate error. I tried changing in Apache directly and it worked. I know this is not te best solution but it can be labelled as a workaround.
Webserver Setting > Webserver Conf Editor > Apache Tab > Vhost file tab > Select Configuration file for Domain you wish to change redirection.
Before:
<VirtualHost 103.205.140.126:80>
ServerName webmail.domain.com
<IfModule mod_proxy.c>
ProxyRequests Off
ProxyPreserveHost On
.
.
.
After:
.
.
.
<VirtualHost 103.205.140.126:80>
ServerName webmail.domain.com
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}$1 [R,L]
<IfModule mod_proxy.c>
ProxyRequests Off
ProxyPreserveHost On
.
.
.
[code]
Do the same for mail.domain.com
If you have many domains I think there must be some way to have a common vhost configuration somewhere but not sure. Maybe you need to edit the template and rebuild apache to make this rule server-wide in one shot.