Nginx and Wordpress... What am I missing?


#1

So I’ve attempted to follow the Nginx guide dreamhost has published but I’m still getting 404 on permalinks.

Another thing to note is that I’m using multiple installs on my server that aren’t in the root directory for my domain.

#######################
# Permalinks

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

this is what I have right now, located in my user/nginx/mysite.net/wordpress.conf

Ideas?


#2

No insight into this at all??


#3

I’m no nginx expert but maybe if you describe what you’re trying to achieve and what error you get exactly, I may get curious enough to get to study nginx rewrite rules with you :slight_smile:

you get 404 (file not found) when you try to get to which url? which URL works instead? (basically describe what you expect and what you actually see).


#4

Sorry it took so long to reply.

Currently if you go to the site it will load the homepage and allow you to login to the wordpress backend. If you go to a page you’ll be served a 404. From my understanding this is because NGINX handles permalinks differently than apache and wordpress will usually write a .htaccess file for pretty permalinks. Since nginx doesn’t read those it wont work right out of the box. So, when looking for the awnser it seems I need to tell nginx to handle those permalinks correctly.


#5

I suppose an alternative is to not use pretty permalinks but I’d rather see /pagename/ in the window than /whatever/pagename.php etc…

I hope this makes sense.