Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Configuration of a wordpress site served from a URL's directory (not the root) on NGINX
server {
server_name www.gubatron.com;
listen 80;
listen [::]:80;
root /media/ebs/data/websites/gubatron.com/;
index index.php index.html index.htm;
# wordpress lives at gubatron.com/blog/...
rewrite ^/blog/wp-admin/(.*) /blog/wp-admin/$1;
#search redirect
rewrite ^/blog/(.*)s=(.*)$ /blog/index.php?s=$2;
try_files $uri $uri/ /blog/index.php$is_args$args;
location ~ \.php {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
include fastcgi_params;
}
location ~ \.git {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.