Wordpress 如何在主网站(NGINX)的路径下加载子域?

Wordpress 如何在主网站(NGINX)的路径下加载子域?,wordpress,nginx,react-router,Wordpress,Nginx,React Router,我有wordpress博客在子域(blog.example.com)中运行,网站是react应用程序在example.com上运行。我想在有人导航到example.com/blog时加载博客 (这可能无关紧要,但更多的信息是,博客在AWS Lightsail中运行,并在Route53中直接配置,网站在EC2中运行,nginx为页面提供服务) 更新: 我仍然希望用户将url视为example.com/blog/abc def而不是blog.example.com/abc def。这可能吗?您可以使

我有wordpress博客在子域(
blog.example.com
)中运行,网站是react应用程序在
example.com
上运行。我想在有人导航到
example.com/blog
时加载博客

(这可能无关紧要,但更多的信息是,博客在AWS Lightsail中运行,并在Route53中直接配置,网站在EC2中运行,nginx为页面提供服务)

更新:


我仍然希望用户将url视为
example.com/blog/abc def
而不是
blog.example.com/abc def
。这可能吗?

您可以使用nginx将example.com/blog重定向到blog.example.com

location ^~ /blog {
    rewrite ^/blog/?(.*)$ https://blog.example.com/$1 permanent;
}

我仍然希望用户看到的url是
example.com/blog/abc def
而不是
blog.example.com/abc def
。可能吗?