ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Несколько сайтов в одном домене


  • To: nginx-ru@xxxxxxxxx
  • Subject: Несколько сайтов в одном домене
  • From: "ZERGEV" <nginx-forum@xxxxxxxx>
  • Date: Thu, 07 Nov 2013 15:11:33 -0500
  • Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=helium.jlkhosting.com; s=x; h=Date:Sender:From:Message-ID:Content-Transfer-Encoding:Content-Type:Subject:To; bh=RSAW228zR1V8CoCDRPPVHnAC5DXad4/irc6Ds2i3XHQ=; b=2yjjGjfi/UQiFj81QrhJD9LqA1O9C8ge+Q3O5TkfzS6irkqzAEZXuTd/Oyue6ya9OJ2oLhijdF9x6L3GjtHugvTOqSuC0Sez8agVN3oeQ0EgpoE2Giqe8ICigpWNogUeNeBFR2aR1L7hsh7xMHJ0b4KQaJKVRrUmaHz4CfoM6RQ=;

Привет,

Есть домен:
http://example.com

Нужно сделать несколько независимых сайтов на WordPress.
URL должны быть вида:
http://example.com/tiger
http://example.com/lynx
http://example.com/lion

По каждой ссылке будет установлен WordPress.

Для начала не могу понять что писать в server_name для каждого из сайтов и
как вообще их разграничить.
На данный момент есть такой конфиг:


server {
        listen 80;
        server_name example.com;
        rewrite ^(.*) http://www.example.com$1 permanent;
}

server {
        listen 80;
        server_name www.example.com;

        client_max_body_size 5m;
        client_body_timeout 60;

        access_log /var/log/nginx/my-wordpress.com-access;
        error_log /var/log/nginx/my-wordpress.com-error error;

        root /var/www/html/my-wordpress.com/;
        index  index.html index.php;

        ### root directory ###
        location / {
                try_files $uri $uri/ /index.php?$args;
        }

        ### security ###
        error_page 403 =404;
        location ~ /\. { access_log off; log_not_found off; deny all; }
        location ~ ~$ { access_log off; log_not_found off; deny all; }
        location ~* wp-admin/includes { deny all; }
        location ~* wp-includes/theme-compat/ { deny all; }
        location ~* wp-includes/js/tinymce/langs/.*\.php { deny all; }
        location /wp-includes/ { internal; }
        #location ~* wp-config.php { deny all; }
        location ~* ^/wp-content/uploads/.*.(html|htm|shtml|php)$ {
                types { }
                default_type text/plain;
        }

        #  location ~* wp-admin {
        #      allow <YOUR_IP>;
        #      allow 127.0.0.1;
        #      deny all;
        #  }

        ### disable logging ###
        location = /robots.txt { access_log off; log_not_found off; }
        location = /favicon.ico { access_log off; log_not_found off; }

        ### caches ###
        location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ { access_log off;
expires max; }
        location ~* \.(woff|svg)$ { access_log off; log_not_found off;
expires 30d; }
        location ~* \.(js)$ { access_log off; log_not_found off; expires 7d;
}

        ### php block ###
        location ~ \.php?$ {
                try_files $uri =404;
                include fastcgi_params;
                #fastcgi_pass 127.0.0.1:9001;
                fastcgi_pass unix:/var/run/php-wordpress.socket;
                fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
                fastcgi_intercept_errors on;
                fastcgi_split_path_info ^(.+\.php)(.*)$;
                #Prevent version info leakage
                fastcgi_hide_header X-Powered-By;
        }
}

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?21,244522,244522#msg-244522

_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.