# NGINX # FILE: /usr/local/etc/nginx/conf.d/drupal8.conf location ~ \.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$ { access_log off; log_not_found off; return 403; } location ~ ^/private/ { access_log off; log_not_found off; return 403; } location ~ ^/sites/default/files/private/ { access_log off; log_not_found off; return 403; } location ~ ^/sites/default/config/ { access_log off; log_not_found off; return 403; } location ~ ^/sites/default/files/config/ { access_log off; log_not_found off; return 403; } location ~ /sites/default/files/.*\.php$ { access_log off; log_not_found off; return 403; } location ~ ^/(favicon.ico|robots.txt) { access_log off; log_not_found off; add_header Cache-Control max-age=86400; } # web fonts location ~* \.(eot|ttf|woff|otf|svg)$ { try_files $uri $uri/ @cleanurl; access_log off; log_not_found off; expires max; add_header Access-Control-Allow-Origin *; } location ~* \.(svgz)$ { try_files $uri $uri/ @cleanurl; access_log off; log_not_found off; expires max; add_header Content-encoding gzip; gzip off; } location ~* ^.+\.(ogg|ogv|mp4|ttf|rss|atom|jpe?g|gif|png|ico|zip|pdf|t?gz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|swf|bmp|txt|rtf|md)$ { access_log off; log_not_found off; expires max; add_header Cache-Control "public"; add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Methods "GET,OPTIONS"; add_header Access-Control-Allow-Headers Content-Type; add_header Access-Control-Max-Age 86400; } # page reqeusts location / { try_files $uri $uri/ @cleanurl; error_page 403 /403.html; ### add_header X-Proxy-Cache $upstream_cache_status; } location @cleanurl { rewrite ^/(.*)$ /index.php?q=$1 last; } location ~* \.php$ { # do not cache dynamic content expires off; # filter out problem conditions try_files $uri $uri/ @cleanurl =404; # send requests to upstream fastcgi_pass phpfpm; # bring in parameters include conf.d/fastcgi.conf; }