Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # $ cat /usr/local/nginx/conf/http.hosts.conf
- server {
- listen 80;
- server_name ~^(:?(?<second>.+)\.)?(?<domain>[^.]+\.[^.]+)$;
- index index.php index.html;
- set $try_dir $domain;
- if (-d /var/www/hosts/$second.$domain) {
- set $try_dir $second.$domain;
- }
- root /var/www/hosts/$try_dir;
- access_log /var/log/nginx/access.$try_dir.log;
- error_log /var/log/nginx/error.log;
- location / {
- try_files $uri $uri/ /index.php?$args;
- }
- keepalive_timeout 0;
- fastcgi_read_timeout 999999;
- client_body_in_file_only clean;
- client_body_buffer_size 32K;
- client_max_body_size 300M;
- sendfile on;
- send_timeout 1024s;
- location ~ [^/]\.php(/|$) {
- fastcgi_split_path_info ^(.+?\.php)(/.*)$;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- include fastcgi_params;
- 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;
- fastcgi_param PHP_VALUE "newrelic.appname=$domain";
- try_files $uri =404;
- }
- #location ~ \.(js|ico|gif|jpg|png|css|rar|zip|tar\.gz)$ { }
- location ~ /\.(ht|gitignore) { # deny access to .htaccess files, if Apache's document root concurs with nginx's one
- deny all;
- }
- location ~ \.(neon|ini|log|yml)$ { # deny access to configuration files
- 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