Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nginx version: nginx/1.10.3 (Ubuntu)
- upstream php {
- server unix:/var/run/php/php7.2-fpm.sock;
- }
- server {
- charset utf-8;
- client_max_body_size 1M;
- listen 80;
- server_name domain.ru;
- set $root /var/www/domain;
- root $root/web/site/web/;
- index index.php;
- disable_symlinks off;
- access_log /var/log/www/domain/site-access.log combined buffer=5M flush=5m;
- error_log /var/log/www/domain/site-error.log;
- if (-f $document_root/maintenance.html) {
- return 503;
- }
- location / {
- try_files $uri $uri/ /index.php$is_args$args;
- }
- location = /blank.gif {
- empty_gif;
- }
- location ~ ^/assets/.*\.php$ {
- deny all;
- }
- location ~ ^/fetch(.+)$ {
- internal;
- fastcgi_pass php;
- fastcgi_store on;
- fastcgi_store_access user:rw group:rw all:r;
- fastcgi_temp_path /tmp 1 2;
- alias $root$1;
- }
- location ~ ^/images/([avatar|building|block|offer|floor].+\.[jpg|jpeg|gif|png]+)$ {
- expires 1y;
- error_page 404 403 415 /blank.gif;
- valid_referers none blocked server_names ~\.domain\.ru ~\.google\. ~\.yandex\.;
- if ($invalid_referer) {
- return 403;
- }
- root $root;
- #error_page 404 = /fetch$uri;
- try_files $root$uri /fetch$uri;
- }
- location ~ (.+)\.(css|js|svg)$ {
- charset_types *;
- expires 1y;
- gzip_static on;
- try_files $1.min.$2 $1.$2 $uri;
- }
- location ~ ^/sitemap.*\.xml$ {
- expires modified 1d;
- }
- location ~ \.php$ {
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_pass php;
- try_files $uri =404;
- }
- location ~* /\. {
- deny all;
- }
- }
- =======
- /var/www/domain/images # tree
- .
- ├── building
- │ └── 73
- │ └── 3a
- │ └── zhk-bauman-house-1200x404.jpeg
- └── original
- └── 90
- └── 36
- └── 9036870d5f51611d3f61eaecb12948cb0d45e5a4
- file /var/www/domain/images/building/73/3a/zhk-bauman-house-1200x404.jpeg
- /var/www/domain/images/building/73/3a/zhk-bauman-house-1200x404.jpeg: empty
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement