Welcome! Log In Create A New Profile

Advanced

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

November 07, 2013 03:11PM
Привет,

Есть домен:
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;
}
}
Subject Author Posted

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

ZERGEV November 07, 2013 03:11PM

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

Михаил Монашёв November 08, 2013 01:28AM

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

ZERGEV November 08, 2013 01:44AM

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

kron November 08, 2013 01:50AM

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

kron November 08, 2013 01:54AM

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

ZERGEV November 08, 2013 07:37PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 151
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready