Advertisement
Guest User

Untitled

a guest
Jan 14th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.42 KB | None | 0 0
  1. server {
  2.     listen                          80;
  3.     server_name                     site.ru www.site.ru;
  4.     root                            /var/www/valhalla/site.ru;
  5.     access_log                      /var/log/nginx/site.ru-access.log;
  6.     error_log                       /var/log/nginx/site.ru-error.log;
  7.     index                           index.php index.html;
  8.     rewrite_log                     on;
  9.     if ($host != 'site.ru' ) {
  10.         rewrite                 ^/(.*)$  http://site.ru/$1  permanent;
  11.     }
  12.     location ~* ^/core/ {
  13.         deny                    all;
  14.     }
  15.     location /api.js {
  16.         deny                    all;
  17.     }
  18.     location / {
  19.         try_files               $uri $uri/ @rewrite;
  20.     }
  21.     location /index.html {
  22.         rewrite                 / / permanent;
  23.     }
  24.  
  25.     location ~ ^/(.*?)/index\.html$ {
  26.         rewrite                 ^/(.*?)/ // permanent;
  27.     }
  28.     location @rewrite {
  29.         rewrite                 ^/(.*)$ /index.php?q=$1;
  30.     }
  31.     location ~ \.php$ {
  32.         include                 fastcgi_params;
  33.         fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
  34.         fastcgi_pass    backend-valhalla;
  35.     }
  36.     location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|bmp)$ {
  37.         access_log           off;
  38.         expires                      10d;
  39.         break;
  40.     }
  41.     location ~ /\.ht {
  42.         deny                    all;
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement