clarkwinkelmann
location ^~ /wordpress {
# Sets /var/www/html as root of example.com/wordpress
alias /var/www/html;
# Get script /var/www/html/index.php
# It's important to start with a slash "/",
# that way it looks for index.php at the root directory,
# not in example.com/wordpress/some-slug/index.php
index /index.php;
# Add a trailing slash if missing
if (!-f $request_filename) {
rewrite [^/]$ $uri/ permanent;
}
# First attempt to serve request as file, then
# as directory, then fall back to index.php
try_files $uri $uri/ /index.php?$args;
}
# For security reasons, set php settings at root level.
# This prevents root level php files from showing as plain text.
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
# Change this to your fpm socket
fastcgi_pass php:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
}