upstream php { server 127.0.0.1:9000; } #map $http_x_forwarded_proto $fastcgi_https { # default $https; # http ''; # https on; #} server { server_name nginx.local; listen 80 default_server; # http2; root ""; index index.php; include fastcgi.conf; fastcgi_hide_header 'X-Drupal-Cache'; fastcgi_hide_header 'X-Generator'; fastcgi_hide_header 'X-Drupal-Dynamic-Cache'; location / { # use for AWS healthcheck path otherwise it will always return 400 response location = /health/ { return 200; } location ~* /system/files/ { include fastcgi.conf; fastcgi_param QUERY_STRING q=$uri&$args; fastcgi_param SCRIPT_NAME /index.php; fastcgi_param SCRIPT_FILENAME $document_root/index.php; fastcgi_pass php; log_not_found off; } location ~* /sites/.+/files/private/ { internal; } location ~* /files/styles/ { access_log off; expires 30d; try_files $uri @drupal; } location ~* /sites/.+/files/.+\.txt { access_log off; expires 30d; tcp_nodelay off; open_file_cache max=3000 inactive=120s; open_file_cache_valid 45s; open_file_cache_min_uses 2; open_file_cache_errors off; } location ~* /sites/.+/files/advagg_css/ { expires max; add_header ETag ''; add_header Last-Modified 'Wed, 20 Jan 1988 04:20:42 GMT'; add_header Accept-Ranges ''; location ~* /sites/.*/files/advagg_css/css[_[:alnum:]]+\.css$ { access_log off; try_files $uri @drupal; } } location ~* /sites/.+/files/advagg_js/ { expires max; add_header ETag ''; add_header Last-Modified 'Wed, 20 Jan 1988 04:20:42 GMT'; add_header Accept-Ranges ''; location ~* /sites/.*/files/advagg_js/js[_[:alnum:]]+\.js$ { access_log off; try_files $uri @drupal; } } location ~* /admin/reports/hacked/.+/diff/ { try_files $uri @drupal; } location ~* ^.+\.xml { try_files $uri @drupal; } location ~* ^.+\.(?:css|cur|js|jpe?g|gif|htc|ico|png|xml|otf|ttf|eot|woff|woff2|svg|svgz)$ { access_log off; expires 30d; tcp_nodelay off; open_file_cache max=3000 inactive=120s; open_file_cache_valid 45s; open_file_cache_min_uses 2; open_file_cache_errors off; location ~* ^.+\.svgz$ { gzip off; add_header Content-Encoding gzip; } } location ~* ^.+\.(?:pdf|pptx?)$ { expires 30d; tcp_nodelay off; } location ~* ^(?:.+\.(?:htaccess|make|txt|engine|inc|info|install|module|profile|po|pot|sh|.*sql|test|theme|tpl(?:\.php)?|xtmpl)|code-style\.pl|/Entries.*|/Repository|/Root|/Tag|/Template)$ { return 404; } try_files $uri @drupal; } location /blm-import { include fastcgi.conf; fastcgi_param QUERY_STRING $query_string; fastcgi_param SCRIPT_NAME /index.php; fastcgi_param SCRIPT_FILENAME $document_root/index.php; fastcgi_pass php; fastcgi_read_timeout 1200; fastcgi_buffers 16 32k; fastcgi_buffer_size 64k; fastcgi_busy_buffers_size 64k; # track_uploads uploads 60s; } location @drupal { include fastcgi.conf; fastcgi_param QUERY_STRING $query_string; fastcgi_param SCRIPT_NAME /index.php; fastcgi_param SCRIPT_FILENAME $document_root/index.php; fastcgi_pass php; fastcgi_buffers 16 32k; fastcgi_buffer_size 64k; fastcgi_busy_buffers_size 64k; # track_uploads uploads 60s; } location @drupal-no-args { include fastcgi.conf; fastcgi_param QUERY_STRING q=$uri; fastcgi_param SCRIPT_NAME /index.php; fastcgi_param SCRIPT_FILENAME $document_root/index.php; fastcgi_pass php; } location = /index.php { fastcgi_pass php; } location = /core/install.php { fastcgi_pass php; } location ~* ^/core/authorize.php { include fastcgi.conf; fastcgi_param QUERY_STRING $args; fastcgi_param SCRIPT_NAME /core/authorize.php; fastcgi_param SCRIPT_FILENAME $document_root/core/authorize.php; fastcgi_pass php; } location = /core/modules/statistics/statistics.php { fastcgi_pass php; } location = /cron { include fastcgi.conf; fastcgi_param QUERY_STRING $args; fastcgi_param SCRIPT_NAME /index.php; fastcgi_param SCRIPT_FILENAME $document_root/index.php; fastcgi_pass php; } location ~* ^/update.php { include fastcgi.conf; fastcgi_param QUERY_STRING $args; fastcgi_param SCRIPT_NAME /update.php; fastcgi_param SCRIPT_FILENAME $document_root/update.php; fastcgi_pass php; } location ^~ /.bzr { return 404; } location ^~ /.git { return 404; } location ^~ /.hg { return 404; } location ^~ /.svn { return 404; } location ^~ /.cvs { return 404; } location ^~ /patches { return 404; } location ^~ /backup { return 404; } location = /robots.txt { access_log off; try_files $uri @drupal-no-args; } location = /favicon.ico { expires 30d; try_files /favicon.ico @empty; } location ~* ^/.well-known/ { allow all; } location @empty { expires 30d; empty_gif; } location ~* ^.+\.php$ { return 404; } location ~ (?.*)/x-progress-id:(?\d*) { rewrite ^ $upload_form_uri?X-Progress-ID=$upload_id; } # location ~ ^/progress$ { # upload_progress_json_output; # report_uploads uploads; # } # include healthz.conf; # include pagespeed.conf; }