0

I've got a few questions about Nginx that I can't seem to find a clear answer on. I'm currently having with my WordPress Multisite—the images aren't showing up. A common problem, easily solved with some .htaccess file modifications. But this server uses Nginx, so I need to dig into nginx.conf. A few questions below:

  • Do I modify the sites-available/mysite file, or should I be using the html/nginx.conf for this type of thing?
  • Do I need to restart Nginx after modifying my conf files?

A few things to consider:

  • I'm using subdirectories in my WordPress multisite
  • The site is loading and functioning properly, the WordPress configuration—or rather, some of its required redirects—are the only thing that needs to be altered.

Thanks so much for any help.

  • can you share your already in-use configuration? Probably you need to change the file system depth of nginx (or php-fpm) – ilhnctn Nov 02 '14 at 20:49

1 Answers1

0
  • Do I modify the sites-available/mysite file, or should I be using the html/nginx.conf for this type of thing?

Using custom configurations (sites-available/your-conf) is prefered when using nginx. nginx can also be used as a load-balance system just by these configs.

  • Do I need to restart Nginx after modifying my conf files? Yes you do.

Below is an sample configuration (which is already running with proper naming instead of wordpress.

Also, official documentation about Wordpress Mulltisite may give you an idea.

server {
            listen 80;

            root /var/www/wordpress;
            index index.php index.html index.htm;

            access_log /var/log/nginx/wordpress.access.log;
            error_log /var/log/nginx/wordpress.error.log;

            # Make site accessible from http://localhost/
            # Add wordpress.local.com to your hosts.conf file if not an alive host
            server_name wordpress.local.com;

            location / {
                    try_files $uri $uri/ /index.php?q=$uri&$args;
            }

            error_page 404 /404.html;

            error_page 500 502 503 504 /50x.html;
            location = /50x.html {
                  root /usr/share/nginx/www;
            }


            include fastcgi.conf;
    }
ilhnctn
  • 2,210
  • 3
  • 23
  • 41
  • Awesome. Thank you for the response! Seems as though I'm having some permission errors within Nginx on this server, but that'll be another problem altogether. I'll keep the Nginx WordPress Wiki on hand—great resource. – jesselcampbell Nov 03 '14 at 01:15
  • please share your solution or accept the answer if solved your issue. – ilhnctn Nov 03 '14 at 07:19
  • 1
    Hi, sorry I forgot to check that as solved. Thanks again for your help. Things are up and running as hoped. – jesselcampbell Nov 04 '14 at 22:20