Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- server_name ~^(:?(?<second>.+)\.)?(?<domain>[^.]+\.[^.]+)$;
- index index.php index.html;
- location / {
- root /var/www/hosts/$second.$domain;
- set $root /var/www/hosts/$second.$domain;
- try_files $uri $uri/ /index.php @fallback;
- }
- location @fallback {
- root /var/www/hosts/$domain;
- set $root /var/www/hosts/$domain;
- try_files $uri $uri/ /index.php;
- }
- keepalive_timeout 0;
- send_timeout 9999999;
- fastcgi_read_timeout 999999;
- client_max_body_size 200M;
- location ~ \.php$ { # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
- root $root;
- include fastcgi_params;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
- fastcgi_param PATH_INFO $fastcgi_path_info;
- fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- }
- #location ~ \.(js|ico|gif|jpg|png|css|rar|zip|tar\.gz)$ { }
- location ~ /\.ht { # deny access to .htaccess files, if Apache's document root concurs with nginx's one
- deny all;
- }
- location = /robots.txt { access_log off; log_not_found off; }
- location = /favicon.ico { access_log off; log_not_found off; }
- }
Advertisement
Add Comment
Please, Sign In to add comment