forked from arthurfurlan/nginx-config-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
moin.conf
42 lines (36 loc) · 924 Bytes
/
moin.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 {
server_name example.com;
listen 80;
listen 443;
# force the login page via HTTPS
if ($server_port != 443) {
set $login_redirect P;
}
if ($args ~ action=login) {
set $login_redirect "${login_redirect}L";
}
if ($login_redirect = PL) {
rewrite ^ https://$http_host$uri permanent;
}
# directory root
root /srv/example.com/nginx/www;
index index.html index.htm;
location ~ ^/moin_static[0-9]+/(.*)$ {
alias /usr/share/moin/htdocs/$1;
}
location / {
if ($uri ~ ^(.*)?) {
set $wiki_url $1;
}
if (!-f $request_filename) {
fastcgi_pass 127.0.0.1:9001;
}
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $wiki_url;
fastcgi_param SCRIPT_NAME /;
}
# logging
access_log /srv/example.com/nginx/log/access.log;
error_log /srv/example.com/nginx/log/error.log;
}