Skip to content

Commit 7e4b066

Browse files
committed
Fixes access to dot files, performance
1 parent 5ecd14d commit 7e4b066

File tree

4 files changed

+34
-20
lines changed

4 files changed

+34
-20
lines changed

conf-web/nginx.conf

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,22 @@ server {
99
auth_basic_user_file /home/%user%/conf/web/webdav-%user%.%domain%/.htpasswd;
1010
return 301 https://$host$request_uri;
1111

12-
location / {
13-
proxy_pass http://%ip%:%port%;
14-
location ~* ^.+\.(jpg|jpeg|webp|gif|png|ico|svg|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|odt|ods|odp|odf|tar|wav|bmp|rtf|js|mp3|avi|mpeg|flv|html|htm|woff|woff2|ttf)$ {
15-
root /home/%user%/web;
16-
access_log /var/log/apache2/domains/webdev-%user%.%domain%.log combined;
17-
access_log /var/log/apache2/domains/webdav-%user%.%domain%.bytes bytes;
18-
expires max;
19-
try_files $uri @fallback;
20-
}
12+
location ~ /\.* {
13+
allow all;
14+
proxy_pass http://%ip%:%port%;
15+
proxy_buffering off;
16+
client_max_body_size 0;
17+
proxy_read_timeout 120s;
18+
proxy_connect_timeout 90s;
19+
proxy_send_timeout 90s;
20+
proxy_redirect off;
21+
proxy_set_header Host $http_host;
22+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
23+
proxy_set_header X-Forwarded-Proto $scheme;
24+
proxy_set_header X-Forwarded-Ssl on;
25+
proxy_set_header Connection "";
26+
proxy_pass_header Date;
27+
proxy_pass_header Server;
2128
}
2229

2330
location /error/ {

conf-web/nginx.ssl.conf

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,22 @@ server {
1919

2020
include /home/%user%/conf/web/webdav-%user%.%domain%/nginx.hsts.conf*;
2121

22-
location / {
23-
proxy_pass http://%ip%:%port%;
24-
location ~* ^.+\.(jpg|jpeg|webp|gif|png|ico|svg|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|odt|ods|odp|odf|tar|wav|bmp|rtf|js|mp3|avi|mpeg|flv|html|htm|woff|woff2|ttf)$ {
25-
root /home/%user%/web;
26-
access_log /var/log/apache2/domains/webdav-%user%.%domain%.log combined;
27-
access_log /var/log/apache2/domains/webdav-%user%.%domain%.bytes bytes;
28-
expires max;
29-
try_files $uri @fallback;
30-
}
22+
location ~ /\.* {
23+
allow all;
24+
proxy_pass http://%ip%:%port%;
25+
proxy_buffering off;
26+
client_max_body_size 0;
27+
proxy_read_timeout 120s;
28+
proxy_connect_timeout 90s;
29+
proxy_send_timeout 90s;
30+
proxy_redirect off;
31+
proxy_set_header Host $http_host;
32+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
33+
proxy_set_header X-Forwarded-Proto $scheme;
34+
proxy_set_header X-Forwarded-Ssl on;
35+
proxy_set_header Connection "";
36+
proxy_pass_header Date;
37+
proxy_pass_header Server;
3138
}
3239

3340
location /error/ {

uninstall

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
export DEBIAN_FRONTEND=noninteractive
33

44
# Remove rclone
5-
apt-get remove -y rclone
5+
# apt-get remove -y rclone # Rclone is apart of HestiaCP, don't remove it
66

77
# Clean up all webdav users
88
rm -rf /etc/nginx/conf.d/domains/webdav-*

webdav.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public function setup( $user ) {
224224

225225
// Start the WebDAV service on the given port.
226226
$cmd = 'runuser -l ' . $user . ' -c "';
227-
$cmd .= "(rclone serve webdav --addr $ip:$port /home/$user/web) > /dev/null 2>&1 &";
227+
$cmd .= "(rclone serve webdav --vfs-cache-mode full --addr $ip:$port /home/$user/web) > /dev/null 2>&1 &";
228228
$cmd .= '"';
229229
$cmd = $hcpp->do_action( 'webdav_rclone_cmd', $cmd );
230230
shell_exec( $cmd );

0 commit comments

Comments
 (0)