I've got a site called example.com which serves static HTML content like https://example.com/index.html and https://example.com/folder/file.html etc.

I've got a WordPress multiste setup on the same server that serves a WordPress site.

What I want is for example.com/blog/ to serve the response from multisite.com/blog/ . example.com/blog/wp-admin/ should work just like multisite.com/blog/wp-admin/ but the URL in the address bar remains example.com/blog/wp-admin/. I'm guessing I would need to mess with proxy_pass but I haven't gotten it to work.

Here's my configuration:

server {
    server_name example.com www.example.com;

    access_log /var/log/nginx/example.com.access.log rt_cache;
    error_log /var/log/nginx/example.com.error.log;

    location / {
        root /var/www/example.com/htdocs;

        index index.php index.html index.htm;
        try_files $uri $uri/ /index.php$is_args$args;

        location ~ \.php$ {
           try_files $uri =404;
           include fastcgi_params;
           fastcgi_pass php82;
       }
    }

    location /blog {
      proxy_redirect off;
      proxy_set_header Host $http_host;
      proxy_set_header X-Forwarded-Host $http_host;
      proxy_pass "http://multisite.com$request_uri";
      # root /var/www/multisite.com/htdocs;
    }

    # include common/php82.conf;

    include common/locations-wo.conf;
    include /var/www/example.com/conf/nginx/*.conf;

}

Both sites are hosted on the same server if that helps at all. Any ideas?

Hosted by VirtuBox