HosipLan

Untitled

May 11th, 2012
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. server {
  2.         listen          80;                                                                                                                                                            
  3.         server_name     ~^(:?(?<second>.+)\.)?(?<domain>[^.]+\.[^.]+)$;                                                                                                                
  4.         index           index.php index.html;                                                                                                                                          
  5.  
  6.  
  7.         location / {
  8.                 root            /var/www/hosts/$second.$domain;
  9.                 set             $root /var/www/hosts/$second.$domain;
  10.                 try_files       $uri $uri/ /index.php @fallback;
  11.         }
  12.  
  13.         location @fallback {
  14.                 root            /var/www/hosts/$domain;
  15.                 set             $root /var/www/hosts/$domain;
  16.                 try_files       $uri $uri/ /index.php;
  17.         }
  18.  
  19.         keepalive_timeout  0;
  20.         send_timeout    9999999;
  21.         fastcgi_read_timeout    999999;
  22.         client_max_body_size    200M;
  23.  
  24.         location ~ \.php$ { # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  25.                 root            $root;
  26.                 include         fastcgi_params;
  27.                 fastcgi_pass    127.0.0.1:9000;
  28.                 fastcgi_index   index.php;
  29.  
  30.                 fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
  31.                 fastcgi_param   PATH_INFO $fastcgi_path_info;
  32.                 fastcgi_param   PATH_TRANSLATED $document_root$fastcgi_path_info;
  33.  
  34.                 fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
  35.         }
  36.  
  37.         #location ~ \.(js|ico|gif|jpg|png|css|rar|zip|tar\.gz)$ { }
  38.         location ~ /\.ht { # deny access to .htaccess files, if Apache's document root concurs with nginx's one
  39.             deny  all;
  40.         }
  41.  
  42.         location = /robots.txt  { access_log off; log_not_found off; }
  43.         location = /favicon.ico { access_log off; log_not_found off; }
  44.     }
Advertisement
Add Comment
Please, Sign In to add comment