Updated Setting up Drupal 7 (markdown)
							parent
							
								
									4f4a60f9fc
								
							
						
					
					
						commit
						473076507c
					
				
					 1 changed files with 44 additions and 14 deletions
				
			
		| 
						 | 
				
			
			@ -64,52 +64,82 @@ server {
 | 
			
		|||
        error_log  /var/log/nginx/cms.example.com.error.log info;
 | 
			
		||||
 
 | 
			
		||||
        index index.php;
 | 
			
		||||
 
 | 
			
		||||
 | 
			
		||||
        location = /favicon.ico {
 | 
			
		||||
                log_not_found off;
 | 
			
		||||
                access_log off;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
 | 
			
		||||
        location = /robots.txt {
 | 
			
		||||
                allow all;
 | 
			
		||||
                log_not_found off;
 | 
			
		||||
                access_log off;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
 | 
			
		||||
        # This matters if you use drush
 | 
			
		||||
        location = /backup {
 | 
			
		||||
                deny all;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
 | 
			
		||||
        # Very rarely should these ever be accessed outside of your lan
 | 
			
		||||
        location ~* \.(txt|log)$ {
 | 
			
		||||
                allow 127.0.0.1;
 | 
			
		||||
                deny all;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
 | 
			
		||||
        location ~ \.php$ {
 | 
			
		||||
                try_files $uri =404;
 | 
			
		||||
                fastcgi_index index.php;
 | 
			
		||||
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 | 
			
		||||
                fastcgi_param HTTP_PROXY "";
 | 
			
		||||
                include /etc/nginx/fastcgi_params;
 | 
			
		||||
                fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        location ~ \..*/.*\.php {
 | 
			
		||||
                return 403;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
 | 
			
		||||
        location / {
 | 
			
		||||
                # This is cool because no php is touched for static content
 | 
			
		||||
                try_files $uri $uri/ @rewrite;
 | 
			
		||||
                expires max;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
 | 
			
		||||
        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$ {
 | 
			
		||||
                include fastcgi_params;
 | 
			
		||||
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 | 
			
		||||
                fastcgi_intercept_errors on;
 | 
			
		||||
                fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
 | 
			
		||||
 | 
			
		||||
        location ~ ^/sites/.*/files/imagecache/ {
 | 
			
		||||
                try_files $uri @rewrite;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        location ~ ^/sites/.*/files/styles/ {
 | 
			
		||||
                try_files $uri @rewrite;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
 | 
			
		||||
               expires max;
 | 
			
		||||
               log_not_found off;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        location ~ /\. {
 | 
			
		||||
               deny all;
 | 
			
		||||
               access_log off;
 | 
			
		||||
               log_not_found off;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        location ~ ~$ {
 | 
			
		||||
               access_log off;
 | 
			
		||||
               log_not_found off;
 | 
			
		||||
               deny all;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        location ~ ^/sites/.*/files/(private|temp|tmp|backup_migrate) {
 | 
			
		||||
                 deny all;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue