forked from timlegge/docker-foswiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.default.conf
42 lines (34 loc) · 1.28 KB
/
nginx.default.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
server {
listen 80;
server_name _;
set $foswiki_root "/var/www/foswiki";
root $foswiki_root;
access_log /var/log/nginx/foswiki-access.log;
error_log /var/log/nginx/foswiki-error.log debug;
location = / {
root $foswiki_root;
rewrite .* /Main/WebHome;
}
location ~ ^/([A-Z_].*)$ {
rewrite ^/(.*)$ /bin/view/$1;
}
location ~ (^/pub) {
allow all;
}
location ~ ^/bin/([a-z]+) {
fastcgi_param SCRIPT_NAME $1;
gzip off;
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(/bin/\w+)(.*);
fastcgi_param SCRIPT_FILENAME $foswiki_root/$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
}
location ~ (^/lib|^/data|^/locale|^/templates|^/tools|^/work) {
deny all;
}
if ($http_user_agent ~ ^SiteSucker|^iGetter|^larbin|^LeechGet|^RealDownload|^Teleport|^Webwhacker|^WebDevil|^Webzip|^Attache|^SiteSnagger|^WX_mail|^EmailCollector|^WhoWhere|^Roverbot|^ActiveAgent|^EmailSiphon|^CrownPeak-HttpAgent|^$) {
rewrite .* /404.html break;
}
}