-
Notifications
You must be signed in to change notification settings - Fork 14
/
moodle.conf
37 lines (31 loc) · 964 Bytes
/
moodle.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
server {
server_name example.com www.example.com;
listen 80;
listen 443;
# canonical domain
include /srv/example.com/nginx/conf/canonical_domain.conf;
# force the login page via HTTPS
if ($server_port != 443) {
rewrite ^/login(/.*)?$ https://$server_name$uri last;
}
# directory root
root /usr/share/moodle;
index index.php index.html index.htm;
# default PHP handler
location ~ \.php$ {
if (!-f $document_root$fastcgi_script_name) {
rewrite ^ 404;
}
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if ($server_port = 443) {
set $fastcgi_param_https on;
}
fastcgi_param HTTPS $fastcgi_param_https;
}
# logging
access_log /srv/example.com/nginx/log/access.log;
error_log /srv/example.com/nginx/log/error.log;
}