An example setup to host a nextjs app along with wordpress with nginx.
Wordpress is available at /content
.
- uses the official wordpress docker image
- wodpress site is available at
/content
- wordpress admin panel can be accessed at -
/wp/wp-admin
- extra wordpress config changes
WP_HOME
is set tohost-ip/content
, this ensures that the wordpress site is hosted at /contentWP_SITEURL
is set tohost-ip/wp
, this allows us to identify and proxy wordpress client's asset requests. As a sideeffect this also changes the path of the admin panel, instead of/wp-admin
it changes toWP_SITEURL/wp-admin
- the starter nextjs app is containerized on top of
node:16-alpine
and runs at port3000
- all paths apart from
/content\w*
and/wp/*
will be proxied to the next server