daily pastebin goal
14%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 151 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. server {
  2.     listen 443 ssl http2;
  3.     listen [::]:443 ssl http2;
  4.    
  5.     server_name www.flaut.ru;
  6.    
  7.     root /var/www/production/flaut;
  8.     index index.php index.html;
  9.  
  10.     if ($request_uri ~* "^(.*/)index\.php$") {
  11.         return 301 $1;
  12.     }
  13.    
  14.     location ~ \.php$ {
  15.         include snippets/fastcgi-php.conf;
  16.         fastcgi_pass unix:/run/php/php7.2-fpm.sock;
  17.     }
  18.    
  19.     location / {
  20.         if ($args ~ "_escaped_fragment_") {
  21.             return 410;
  22.         }
  23.  
  24.         try_files $uri @prerender;
  25.     }
  26.  
  27.     location @prerender {
  28.         proxy_set_header X-Prerender-Token dSNi2kdNQINXTYUCKiUd;
  29.  
  30.         set $prerender 0;
  31.  
  32.         if ($http_user_agent ~* "http:\/\/yandex.com\/bots|vkShare|W3C_Validator") {
  33.             set $prerender 1;
  34.         }
  35.  
  36.         if ($http_user_agent ~ "Prerender") {
  37.           set $prerender 0;
  38.         }
  39.  
  40.         if ($uri ~* "\.(js|css|xml|less|png|jpg|jpeg|gif|pdf|doc|txt|ico|rss|zip|mp3|rar|exe|wmv|doc|avi|ppt|mpg|mpeg|tif|wav|mov|psd|ai|xls|mp4|m4a|swf|dat|dmg|iso|flv|m4v|torrent|ttf|woff|svg|eot)") {
  41.             set $prerender 0;
  42.         }
  43.  
  44.         resolver 8.8.8.8;
  45.  
  46.         if ($prerender = 1) {
  47.             set $prerender "service.prerender.io";
  48.             rewrite .* /$scheme://$host$request_uri? break;
  49.             proxy_pass http://$prerender;
  50.         }
  51.     }
  52.    
  53.     location ~* ^.+.(png|jpg|jpeg|gif|ico|json|svg|woff2)$ {
  54.         access_log        off;
  55.         expires           7d;
  56.     }
  57.  
  58.     location ~* ^.+.(html|php)$ {
  59.         expires           epoch;
  60.     }
  61.    
  62.     location ~ /.well-known {
  63.         allow all;
  64.     }
  65.    
  66.     error_page 404 /404.html;
  67.     location = /404.html {
  68.         root /var/www/production/flaut/error-pages/404;
  69.         internal;
  70.     }
  71.    
  72.     error_page 403 /403.html;
  73.     location = /403.html {
  74.         root /var/www/production/flaut/error-pages/403;
  75.         internal;
  76.     }
  77.  
  78.     location ~ ^\/tickets\/([a-z_-]+)\/([a-z_-]+)$ {
  79.         rewrite ^([^.]*[^/])$ $1/ permanent;
  80.     }
  81.  
  82.     location ~ ^\/tickets\/([a-z_-]+)\/([a-z_-]+)\/$ {
  83.         if ($args ~ "_escaped_fragment_") {
  84.             return 410;
  85.         }
  86.        
  87.         index /tickets/generator.php;
  88.     }
  89.  
  90.     location ~ ^\/airlines\/([a-z_-]+)\/$ {
  91.         index /airlines/generator.php;
  92.     }
  93.        
  94.     # SSL-сертификат
  95.     include snippets/ssl-flaut/ssl-flaut.ru.conf;
  96. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top