Local WordPress 5.1.1 multisite with Nginx
-
Hello! I’ve installed WordPress 5.1.1 locally onto my macbook, and it is being served by Nginx 1.15.8 out of the /wordpress/ subfolder. Initially, everything was working fine, until I tried to setup a subfolder multisite. The main sites still work. For example, the following links still load as expected:
https://localhost/wordpress/ (main site) https://localhost/wordpress/blog/1/hello-world/ (blog post on the main site) https://localhost/wordpress/wp-admin/ (admin for main site) https://localhost/wordpress/wp-admin/network/ (multisite network admin)
However my new multisite (named multisite) doesn’t load properly.
https://localhost/wordpress/multisite/ loads but all of the resources 404, such as https://localhost/wordpress/multisite/wp-includes/css/dist/block-library/theme.min.css. https://localhost/wordpress/multisite/wp-admin/ gets caught in a redirect loop. I am sure it is a problem with my Nginx configuration:http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; gzip on; server { listen 80; server_name localhost; return 301 https://$host$request_uri; } server { listen 443 ssl http2; server_name localhost; # ssl directives removed for brevity root /Users/nicholas.chambers; location ~ \.(js|css|png|jpg|jpeg|gif|ico|ttf|woff) { try_files $uri =404; } location ~ /wordpress/(.*)(\.php)?$ { index index.php index.html; try_files $uri $uri.php /wordpress/$1/index.php /wordpress/index.php =404; fastcgi_pass 127.0.0.1:9000; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; } } }
I am just not sure what I need to do to fix it. I know pages like https://www.nginx.com/resources/wiki/start/topics/recipes/wordpress/ and https://codex.www.ads-software.com/Nginx exist, but these assume a blogs.dir folder, which my multisite doesn’t appear to have:
nicholas-chambers:wordpress nicholas.chambers$ find . -name blogs.dir -type d -print nicholas-chambers:wordpress nicholas.chambers$
If anyone could point me in the right direction, that would be great.
- The topic ‘Local WordPress 5.1.1 multisite with Nginx’ is closed to new replies.