Hi everyone,
I’m trying to transform a single site to a multisite.
The server tech is nginx, and the whole system is containerized.
There are two docker containers: a container for the bedrock and a different container for nginx.
We also use ELB for load balancing.
I tried adding the following lines with no success, in application.php
and default.conf
:
application.php:
define( 'WP_ALLOW_MULTISITE', true );
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', 'http://localhost');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
default.conf:
server {
listen 80;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
proxy_read_timeout 150;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
...
}
# Prevent PHP scripts from being executed inside the uploads folder.
location ~* /app/uploads/.*.php$ {
deny all;
}
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico||bz2|doc|xls|ppt|mid|midi|wav|bmp|rtf)$ {
...
}
# This should match upload_max_filesize in php.ini
#upload files size restriction
location ~* ^.+\.(jpg|jpeg|gif) {
client_max_body_size 6m;
}
location ~* \.(avi|mp4) {
client_max_body_size 15m;
}
# Deny public access to wp-config.php
location ~* wp-config.php {
deny all;
}
# nginx block xmlrpc.php requests
location /xmlrpc.php {
deny all;
}
#articles
location ~ ^/[\d+]/articles/(.*) {
# rewrite_log on;
return 301 https://$host/?p=$1;
}
location ~ ^/[\d+]/item/(.*) {
# rewrite_log on;
return 301 https://$host/?p=$1;
}
client_max_body_size 6m;
rewrite ^/(wp-.*.php)$ /wp/$1 last;
rewrite ^/(wp-(content|admin|includes).*) /wp/$1 last;
}
When I navigate to https://mysite.com/wp/wp-admin/network.php
I receive the message:
Warning: An existing WordPress network was detected.
I cannot configure the network or add content to any site in it. It’s if it didn’t exist.
What am I missing here?