Skip to content

Commit 77d8aa8

Browse files
committed
enable xsendfile and fix #26
1 parent 460b40d commit 77d8aa8

File tree

4 files changed

+9
-16
lines changed

4 files changed

+9
-16
lines changed

.vscode/settings.json

-6
This file was deleted.

Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ RUN cd /var/www/foswiki && \
134134
rm -fr /var/www/foswiki/working/configure/download/* && \
135135
rm -fr /var/www/foswiki/working/configure/backup/*
136136

137+
RUN cd /var/www/foswiki && \
138+
tools/configure -save -set {PermittedRedirectHostUrls}='http://docker-foswiki.local:8765,https://docker-foswiki.local:8443' && \
139+
tools/configure -save -set {XSendFileContrib}{Header}='X-Accel-Redirect' && \
140+
tools/configure -save -set {XSendFileContrib}{Location}='/files'
141+
137142
RUN mkdir -p /run/nginx && \
138143
mkdir -p /etc/nginx/conf.d
139144

https/nginx.default.conf

+2-5
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,10 @@ server {
5757

5858
# any other static files need to be sanctioned by the foswiki backened
5959
location /pub {
60-
root $foswiki_root;
61-
rewrite ^/pub/(.*)$ /bin/viewfile/$1;
62-
# or by XSendFileContrib using
63-
#
60+
# The following setting must be in LocalSite.cfg
6461
# {XSendFileContrib}{Header} = 'X-Accel-Redirect';
6562
# {XSendFileContrib}{Location} = '/files';
66-
#rewrite ^/pub/(.*)$ /bin/xsendfile/$1;
63+
rewrite ^/pub/(.*)$ /bin/xsendfile/$1;
6764
}
6865

6966
# internal location that sendfile serves sanctioned static files from

nginx.default.conf

+2-5
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,10 @@ server {
4444

4545
# any other static files need to be sanctioned by the foswiki backened
4646
location /pub {
47-
root $foswiki_root;
48-
rewrite ^/pub/(.*)$ /bin/viewfile/$1;
49-
# or by XSendFileContrib using
50-
#
47+
# The following setting must be in LocalSite.cfg
5148
# {XSendFileContrib}{Header} = 'X-Accel-Redirect';
5249
# {XSendFileContrib}{Location} = '/files';
53-
#rewrite ^/pub/(.*)$ /bin/xsendfile/$1;
50+
rewrite ^/pub/(.*)$ /bin/xsendfile/$1;
5451
}
5552

5653
# internal location that sendfile serves sanctioned static files from

0 commit comments

Comments
 (0)