Skip to content

Commit 44a00f4

Browse files
committed
force SSL on Internet
1 parent 84e7691 commit 44a00f4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

webdav.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@ public function setup( $user ) {
181181
$hcpp->cg_pws->generate_website_cert( $user, ["webdav-$user.$domain"] );
182182
}
183183
}else{
184+
185+
// Force SSL on non-Personal Web Server edition.
186+
$force_ssl_conf = "/home/$user/conf/web/webdav-$user.$domain/nginx.forcessl.conf";
187+
$content = "return 301 https://$host$request_uri;";
188+
file_put_contents( $force_ssl_conf, $content );
189+
184190
// TODO: support for LE
185191
}
186192

@@ -200,6 +206,8 @@ public function setup( $user ) {
200206
// TODO: support for LE
201207
}
202208

209+
210+
203211
// Start the WebDAV service on the given port.
204212
$cmd = 'runuser -l ' . $user . ' -c "';
205213
$cmd .= "(rclone serve webdav --addr $ip:$port /home/$user/web) > /dev/null 2>&1 &";

0 commit comments

Comments
 (0)