Advertisement
Guest User

Untitled

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