• Resolved vtinq

    (@vtinq)


    I am using Nginx for my webserver. I want to install wordpress but am having trouble with the needed customizations to nginx.conf in order to launch install.php. Does anyone know the needed changes/additions required? (I know there is a Codex entry on this subject, but I need a more basic understanding.)

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    There should not be any changes necessary for the initial install process, or for anything else in the wp-admin area. The only config you need to add for WordPress is to enable non-default permalinks, which don’t affect the install or admin areas.

    Have you configured PHP? Or does the PHP not currently run at all on your server?

    Thread Starter vtinq

    (@vtinq)

    PHP works in most areas. My Nginx.conf root is /var/www. The WordPress install is at /var/www/wordpress. I can do the install with localhost/wordpress/wp-admin/install.php. I can go to the admin page with localhost/wordpress/wp-admin. But when I try to view the site (localhost/wordpress/) or view a post (such as localhost/wordpress/hello-world), I get a blank white page.

    I’m not clear on what you mean by the need to enable non-default permalinks. I changed permalinks to numeric, then entered the URL http://localhost/wordpress/archives/1 and Nginx reports “404 Not Found.”

    Thread Starter vtinq

    (@vtinq)

    Fixed. I forgot I had an index.html file in /var/www/wordpress for testing. I deleted the file, reloaded http://localhost/wordpress/?p=1 and the “Hello World!” post appeared.

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    For non-default permalinks to work in nginx, you’ll need to add some rules to your conf file. WordPress will auto add rules to an .htaccess for Apache, but nginx can load multiple files from multiple locations, so your specific setup will need to decide where you put the rules.

    https://codex.wordpress.org/Nginx#General_WordPress_rules

    The main rule needed would be something like this:

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

    This allows it to fallback to the index.php file for non-default rules, so the WordPress system can parse the URL.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Nginx Customizations?’ is closed to new replies.