Advertisement
Guest User

Untitled

a guest
Dec 25th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.38 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 ~* ^/core/ {
  11.         deny                    all;
  12.     }
  13.     location / {
  14.         try_files               $uri $uri/ @rewrite;
  15.     }
  16.     location /index.html {
  17.         rewrite                 / / permanent;
  18.     }
  19.  
  20.     location ~ ^/(.*?)/index\.html$ {
  21.         rewrite                 ^/(.*?)/ // permanent;
  22.     }
  23.     location @rewrite {
  24.         rewrite                 ^/(.*)$ /index.php?q=$1;
  25.     }
  26.     location ~ \.php$ {
  27.         include                 fastcgi_params;
  28.         fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
  29.         fastcgi_pass    backend-valhalla;
  30.     }
  31.     location ~* ^.+\.(jpg|jpeg|gif|png|ico|bmp)$ {
  32.         #access_log           off;
  33.         expires                      10d;
  34.         break;
  35.     }
  36.    
  37.     location ~* ^.+\.(css|js)$ {
  38.         #access_log           off;
  39.         expires                      epoch;
  40.         break;
  41.     }
  42.  
  43.     location ~ /\.ht {
  44.         deny                    all;
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement