Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- map $http_x_forwarded_proto $fastcgi_https {
- default $https;
- http '';
- https on;
- }
- upstream php {
- server unix:/run/php/php7.3-fpm.sock;
- }
- server {
- server_name _;
- root /home/user/www; ## <-- Your only path reference.
- access_log /home/user/logs/access.log;
- error_log /home/user/logs/error.log;
- real_ip_header X-Forwarded-For;
- set_real_ip_from 10.0.0.0/16;
- location /elb-status {
- access_log off;
- return 200 'Health OK';
- # because default content-type is application/octet-stream,
- # browser will offer to "save the file"...
- # the next line allows you to see it in the browser so you can test
- add_header Content-Type text/plain;
- }
- error_page 404 = /404;
- location / {
- error_page 404 = /node/896;
- include /etc/nginx/snippets/redirects.conf;
- 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 ~* /files/private/ {
- internal;
- }
- location ~* /files/styles/ {
- access_log off;
- expires 30d;
- try_files $uri @drupal;
- }
- location ~* /files/.+\.txt {
- access_log off;
- expires 30d;
- tcp_nodelay off;
- open_file_cache off;
- open_file_cache_valid 45s;
- open_file_cache_min_uses 2;
- open_file_cache_errors off;
- }
- location ~* /files/advagg_css/ {
- expires max;
- add_header ETag '';
- add_header Last-Modified 'Wed, 20 Jan 1988 04:20:42 GMT';
- add_header Accept-Ranges '';
- add_header Cache-Control "max-age=31449600, no-transform, public";
- location ~* /files/advagg_css/css[_[:alnum:]]+\.css$ {
- access_log off;
- try_files $uri $uri/ @drupal;
- }
- }
- location ~* /files/advagg_js/ {
- expires max;
- add_header ETag '';
- add_header Last-Modified 'Wed, 20 Jan 1988 04:20:42 GMT';
- add_header Accept-Ranges '';
- add_header Cache-Control "max-age=31449600, no-transform, public";
- location ~* /files/advagg_js/js[_[:alnum:]]+\.js$ {
- access_log off;
- try_files $uri $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 off;
- 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 ~* /admin/reports/hacked/.+/diff/ {
- try_files $uri @drupal;
- }
- location ~* /rss.xml {
- add_header X-Test 'test always';
- try_files $uri @drupal-no-args;
- }
- location ~* /sitemap.xml {
- try_files $uri @drupal;
- }
- 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 @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_param SERVER_NAME $host;
- fastcgi_param HTTP_X_GEOIP_COUNTRY $geoip2_data_country_code;
- fastcgi_param HTTP_X_GeoIP_CountryIP $realip;
- }
- 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;
- fastcgi_param SERVER_NAME $host;
- fastcgi_param HTTP_X_GEOIP_COUNTRY $geoip2_data_country_code;
- fastcgi_param HTTP_X_GeoIP_CountryIP $realip;
- }
- location = /index.php {
- fastcgi_pass php;
- fastcgi_param SERVER_NAME $host;
- fastcgi_param HTTP_X_GEOIP_COUNTRY $geoip2_data_country_code;
- fastcgi_param HTTP_X_GeoIP_CountryIP $realip;
- }
- location = /core/install.php {
- fastcgi_pass php;
- fastcgi_param SERVER_NAME $host;
- fastcgi_param HTTP_X_GEOIP_COUNTRY $geoip2_data_country_code;
- fastcgi_param HTTP_X_GeoIP_CountryIP $realip;
- }
- 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;
- fastcgi_param SERVER_NAME $host;
- fastcgi_param HTTP_X_GEOIP_COUNTRY $geoip2_data_country_code;
- fastcgi_param HTTP_X_GeoIP_CountryIP $realip;
- }
- location = /core/modules/statistics/statistics.php {
- fastcgi_pass php;
- fastcgi_param SERVER_NAME $host;
- fastcgi_param HTTP_X_GEOIP_COUNTRY $geoip2_data_country_code;
- fastcgi_param HTTP_X_GeoIP_CountryIP $realip;
- }
- 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;
- fastcgi_param SERVER_NAME $host;
- fastcgi_param HTTP_X_GEOIP_COUNTRY $geoip2_data_country_code;
- fastcgi_param HTTP_X_GeoIP_CountryIP $realip;
- }
- 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;
- fastcgi_param SERVER_NAME $host;
- fastcgi_param HTTP_X_GEOIP_COUNTRY $geoip2_data_country_code;
- fastcgi_param HTTP_X_GeoIP_CountryIP $realip;
- }
- 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;
- }
- }
Add Comment
Please, Sign In to add comment