forked from heitorsilva/vagrant-moodlebox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
virtual.host
33 lines (26 loc) · 1012 Bytes
/
virtual.host
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
server {
listen 80;
listen [::]:80;
server_name localhost webserver.vm 192.168.1.2;
index index.php index.html index.htm;
root /home/vagrant/public_html;
access_log off;
try_files $uri $uri/ /index.php?$uri&$args;
client_max_body_size 100M;
rewrite ^/moodle/(.*)/(.*\.php)(/)(.*)$ /moodle/$1/$2?file=/$4 last;
rewrite ^/moodle/(.*\.php)(/)(.*)$ /moodle/$1?file=/$3 last;
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
access_log off;
log_not_found off;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass php-fpm;
fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
}
location = /robots.txt { access_log off; log_not_found off; }
location ~ /\. { deny all; access_log off; log_not_found off; }
}