Home » nginx WordPress subdirectory configuration example

nginx WordPress subdirectory configuration example

This is a simple example of an nginx config for a WordPress site that is setup on a subdirectory install. This is quite literally the exact configuration of this site since our entire WordPress site is at http://robido.com.

We are, as always, open to any suggestions on how we can make this better, and the following config has some stuff that’s specific to this site. One thing that’s always good to have is fastcgi passing through the local unix: protocol so there’s no network overhead. If you need help doing so, add a comment to this post and I’ll send you some steps on how to do that. The rest is fairly basic.

If you are looking to setup phpMyAdmin on for your site(s) like http://yoursite.com/sqladmin/ then check out my other tutorial here:

http://robido.com/nginx/configure-an-nginx-virtual-host-with-phpmyadmin-and-php-fpm/

10 comments on “nginx WordPress subdirectory configuration example

  1. ch on

    Your config works well, except when I attempt to login to wp-admin none of the pages show up. Login works, and I get the sidebar: plugins, themes, dashboard, etc. However, when I press on any of them, the main page remains blank. Except for Jetpack. That page loads fine for some reason.

    Any idea?

    Reply
    • Jeff Hays on

      Hmm, sounds like an error in a plugin or theme file to me. I’d check your PHP error logs for more info. If the problem isn’t obvious:

      Try disabling all the plugins by moving them out of the plugins folder and refreshing the admin. If that fixes it, move your plugins back and enable one at a time. As soon as it breaks, you found the problematic plugin.

      Or… activate any of the default themes and see if that fixes it. If these don’t work, paste your error log here.

      Reply
      • ch on

        Yep, disabling the plugins fixed it. Didn’t find out exactly which plugin caused my problems, as I decided to not activate all my original plugins. Site works now though, thanks!

        Reply
  2. Simon Arazi on

    Hi, nice example, but I’ve already tried something like this.
    Let me explain my problem, and if you could help it will be AWESOME.

    I’m running a WordPress install at this address: http://www.zeek.me
    Everything works perfect and smoothy.

    I also have, in a subdirectory of the WordPress Root, a folder /he where I run another WordPress Install : http://www.zeek.me/he

    My problem is that I can’t work with Postame permalinks because when I set them here is the result:

    http://www.zeek.me/he/contact-us/

    redirects to

    http://www.zeek.me/contact-us/ (the root website)

    Hope I explained it well, and you’ll have a solution for my problem.
    Hope to read from u soon,

    Thanks,

    Simon

    Reply
    • Jeff Hays on

      Hey Simon,

      Does the /he/contact-us link on your other subdirectory install have a contact-us permalink that it’s supposed to render? If it does then what I’ll do is setup a site structure like yours later this evening and do some tests on this config. Usually the try_files should catch the first one (the subdirectory site) but I rarely setup a parent site with a child subdirectory site like this so I’ll have to play around with the configs to see how to resolve this for you.

      Reply
  3. kingsley on

    Hello;

    i am trying to install phpmyadmin on one of my blogs as i have 2 on one digital ocean droplet. how do i go about it? and were is the .conf for sqladmin?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *