HosipLan

Untitled

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