2016-08-17 03:08:27 +08:00
|
|
|
server {
|
2016-08-19 08:05:36 +08:00
|
|
|
listen 80;
|
2016-08-17 03:08:27 +08:00
|
|
|
listen [::]:80;
|
|
|
|
|
2016-08-17 04:32:59 +08:00
|
|
|
#domain name
|
|
|
|
server_name drupal8.dev;
|
2016-08-17 03:08:27 +08:00
|
|
|
|
2016-08-17 04:32:59 +08:00
|
|
|
#file document root. This has to match one of the volumes in docer-composer.yml
|
|
|
|
root /var/www/drupal8;
|
|
|
|
|
|
|
|
# This is the full path to your index file
|
|
|
|
index index.php index.html index.htm;
|
|
|
|
|
|
|
|
## serve imagecache files directly or redirect to drupal if they do not exist.
|
|
|
|
location ~* files/styles {
|
|
|
|
access_log off;
|
|
|
|
expires 30d;
|
|
|
|
try_files $uri @drupal;
|
|
|
|
}
|
|
|
|
|
|
|
|
## serve imagecache files directly or redirect to drupal if they do not exist.
|
|
|
|
location ~* ^.+.(xsl|xml)$ {
|
|
|
|
access_log off;
|
|
|
|
expires 1d;
|
|
|
|
try_files $uri @drupal;
|
|
|
|
}
|
|
|
|
|
|
|
|
## Images and static content is treated different
|
|
|
|
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
|
|
|
|
access_log off;
|
|
|
|
expires 30d;
|
|
|
|
}
|
2016-08-17 03:08:27 +08:00
|
|
|
|
|
|
|
location / {
|
2016-08-17 04:32:59 +08:00
|
|
|
index index.php;
|
|
|
|
# This is cool because no php is touched for static content
|
|
|
|
try_files $uri $uri/ @rewrite;
|
|
|
|
expires max;
|
2016-08-17 03:08:27 +08:00
|
|
|
}
|
|
|
|
|
2016-08-17 04:32:59 +08:00
|
|
|
location @drupal {
|
|
|
|
rewrite ^/(.*)$ /index.php?q=$1 last;
|
2016-08-17 03:08:27 +08:00
|
|
|
}
|
|
|
|
|
2016-08-17 04:32:59 +08:00
|
|
|
location @rewrite {
|
|
|
|
# Some modules enforce no slash (/) at the end of the URL
|
|
|
|
# Else this rewrite block wouldn't be needed (GlobalRedirect)
|
|
|
|
rewrite ^/(.*)$ /index.php?q=$1;
|
|
|
|
}
|
|
|
|
|
|
|
|
location ~ .php$ {
|
2016-08-17 03:08:27 +08:00
|
|
|
fastcgi_pass php-upstream;
|
|
|
|
fastcgi_index index.php;
|
|
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
|
|
include fastcgi_params;
|
|
|
|
}
|
2016-08-19 08:05:36 +08:00
|
|
|
}
|