Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Configuration of a wordpress site served from a URL's directory (not the root) on NGINX
server {
listen 80;
listen [::]:80;
root /media/ebs/data/websites/;
index index.php index.html index.htm;
# wordpress lives at
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