-
Notifications
You must be signed in to change notification settings - Fork 8
/
nginx-default.conf
54 lines (37 loc) · 1.18 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
43
44
45
46
47
48
49
50
51
52
53
54
# SMW HTTP server
server {
listen 80;
server_name localhost 127.0.0.1;
server_name_in_redirect off;
access_log /var/log/nginx/smw.access.log;
error_log /var/log/nginx/smw.error.log;
# Use utf-8
charset utf-8;
source_charset utf-8;
# output compression saves bandwidth
gzip on;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# Default index
index index.html index.php;
root /var/www;
location ^~ /wiki {
#Wiki
rewrite ^/wiki/redirect.php /w/redirect.php last;
rewrite ^/wiki/index.php /w/index.php last;
rewrite ^/wiki/?(.*)$ /w/index.php?title=$1 last;
#try_files $uri $uri/ /w/index.php;
}
# Serve .php files using fast-cgi
location ~ .php$ {
# Common fastcgi settings
include /etc/nginx/fastcgi_params;
# Php settings
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
# Script filename
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}