roles/nginx: Tweaks for vhosts with WordPress
My WordPress blogs have a /wordpress subdirectory in the document root, but I don't serve from the /wordpress URI. Technically, all we need is the tweaks to the try_files: - `?args` passes query strings to php5-fpm - removing 404 from the vhost's try_files so we don't return 404 when the requested file doesn't exist (obviously not all request URI's in WordPress are actual files on the disk) Signed-off-by: Alan Orth <alan.orth@gmail.com>
This commit is contained in:
10
roles/nginx/templates/wordpress.j2
Normal file
10
roles/nginx/templates/wordpress.j2
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
# try for WordPress index.php in /
|
||||
# fall back to index.php + args (passed to php5-fpm later)
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
}
|
||||
|
||||
# Add trailing slash to */wp-admin requests.
|
||||
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
|
||||
|
Reference in New Issue
Block a user