Multisite subdirectory example added
This commit is contained in:
parent
32d5758027
commit
8bd1732647
11
per-site/multisite-subdirectory.conf
Normal file
11
per-site/multisite-subdirectory.conf
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Try static files before passing to ms-files.php.
|
||||||
|
location ~ ^/[_0-9a-zA-Z-]+/files/(.*)$ {
|
||||||
|
try_files /wp-content/blogs.dir/$blogid/files/$2 /wp-includes/ms-files.php?file=$2;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Rewrite multisite '.../wp-.*' and '.../*.php'.
|
||||||
|
if (!-e $request_filename) {
|
||||||
|
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
|
||||||
|
rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
|
||||||
|
rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last;
|
||||||
|
}
|
||||||
1
sites-available/.gitignore
vendored
1
sites-available/.gitignore
vendored
@ -5,5 +5,6 @@
|
|||||||
!.gitignore
|
!.gitignore
|
||||||
!default
|
!default
|
||||||
!fastcgi-cache.com
|
!fastcgi-cache.com
|
||||||
|
!multisite-subdirectory.com
|
||||||
!singlesite.com
|
!singlesite.com
|
||||||
!ssl.com
|
!ssl.com
|
||||||
40
sites-available/multisite-subdirectory.com
Normal file
40
sites-available/multisite-subdirectory.com
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
server {
|
||||||
|
# Ports to listen on
|
||||||
|
listen: 80;
|
||||||
|
|
||||||
|
# Server name to listen for
|
||||||
|
server_name multisite-subdirectory.com;
|
||||||
|
|
||||||
|
# Path to document root
|
||||||
|
root /sites/multisite-subdirectory.com/public;
|
||||||
|
|
||||||
|
# File to be used as index
|
||||||
|
index index.php;
|
||||||
|
|
||||||
|
# Overrides logs defined in global/logs.conf, allows per site logs.
|
||||||
|
access_log /sites/multisite-subdirectory.com/logs/access.log;
|
||||||
|
error_log /sites/multisite-subdirectory.com/logs/error.log;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.php?$args;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Multisite subdirectory install
|
||||||
|
include per-site/multisite-subdirectory.conf;
|
||||||
|
|
||||||
|
location ~ \.php$ {
|
||||||
|
try_files $uri =404;
|
||||||
|
include global/fastcgi-params.conf;
|
||||||
|
|
||||||
|
# Change socket if using PHP pools
|
||||||
|
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Redirect www to non-www
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name: www.multisite-subdirectory.com;
|
||||||
|
|
||||||
|
return 301 $scheme://multisite-subdirectory.com$request_uri;
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user