2020-05-21 12:49:20 +02:00
|
|
|
# WordPress multisite subdirectory rules.
|
|
|
|
|
|
|
|
map $uri $blogname{
|
|
|
|
~^(?P<blogpath>/[^/]+/)files/(.*) $blogpath ;
|
|
|
|
}
|
|
|
|
|
|
|
|
map $blogname $blogid{
|
|
|
|
default -999;
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2020-05-21 19:01:37 +02:00
|
|
|
listen 80;
|
|
|
|
listen [::]:80;
|
2020-05-21 12:49:20 +02:00
|
|
|
|
2020-05-21 19:01:37 +02:00
|
|
|
server_name default_server;
|
2020-05-21 12:49:20 +02:00
|
|
|
|
2020-05-21 19:01:37 +02:00
|
|
|
root /sindominio/wordpress;
|
2020-05-21 12:49:20 +02:00
|
|
|
index index.php;
|
|
|
|
|
|
|
|
client_max_body_size 25M;
|
|
|
|
|
|
|
|
location = /favicon.ico {
|
|
|
|
log_not_found off;
|
|
|
|
access_log off;
|
|
|
|
}
|
|
|
|
|
|
|
|
location = /robots.txt {
|
|
|
|
allow all;
|
|
|
|
log_not_found off;
|
|
|
|
access_log off;
|
|
|
|
}
|
|
|
|
|
|
|
|
location ~ /\. {
|
|
|
|
deny all;
|
|
|
|
}
|
|
|
|
|
|
|
|
location ~* /(?:uploads|files)/.*\.php$ {
|
|
|
|
deny all;
|
|
|
|
}
|
|
|
|
|
|
|
|
location ~ ^(/[^/]+/)?files/(.+) {
|
|
|
|
try_files /wp-content/blogs.dir/$blogid/files/$2 /wp-includes/ms-files.php?file=$2 ;
|
|
|
|
access_log off;
|
|
|
|
log_not_found off; expires max;
|
|
|
|
}
|
|
|
|
|
|
|
|
location ^~ /blogs.dir {
|
|
|
|
internal;
|
|
|
|
alias /home/htdocs/wordpress/stable/wp-content/blogs.dir ;
|
|
|
|
access_log off;
|
|
|
|
log_not_found off; expires max;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!-e $request_filename) {
|
|
|
|
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
|
|
|
|
rewrite ^(/[^/]+)?(/wp-.*) $2 last;
|
|
|
|
rewrite ^(/[^/]+)?(/.*\.php) $2 last;
|
|
|
|
}
|
|
|
|
|
|
|
|
location / {
|
|
|
|
try_files $uri $uri/ /index.php?$args ;
|
|
|
|
}
|
|
|
|
|
|
|
|
location ~ \.php$ {
|
|
|
|
try_files $uri =404;
|
|
|
|
include fastcgi_params;
|
|
|
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
|
|
|
fastcgi_index index.php;
|
|
|
|
fastcgi_read_timeout 300;
|
|
|
|
fastcgi_send_timeout 300;
|
|
|
|
fastcgi_pass wp:9000;
|
|
|
|
}
|
|
|
|
|
|
|
|
access_log /var/log/nginx/wordpress.access.log;
|
|
|
|
error_log /var/log/nginx/wordpress.error.log;
|
|
|
|
|
|
|
|
}
|