Skip to content

Commit

Permalink
Fix redirect loop for subdirs multisite in nginx
Browse files Browse the repository at this point in the history
The nginx.conf was missing some configuration for backends of individual WordCamps to work then using the year as a subdirectory, which is the default now.

Fixes WordPress#782
  • Loading branch information
2ndkauboy committed Feb 20, 2023
1 parent 9d9167c commit 7a214b2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .docker/config/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ server {
access_log off;
}

if (!-e $request_filename) {
rewrite /wp-admin$ $scheme://$host$request_uri/ permanent;
rewrite ^(/[^/]+)?(/wp-.*) $2 last;
rewrite ^(/[^/]+)?(/.*\.php) $2 last;
}

location / {
try_files $uri $uri/ /index.php?$args;
}
Expand Down

0 comments on commit 7a214b2

Please sign in to comment.