One complicated aspect of SEO is hosting your blog on the same domain as the rest of the site. This is arguably very
simple on AWS via ALB which allows sublocation routing, but it became a nightmare when we had to move our resources
awayt from AWS once we had to shutdown our startups and keep the blog churning content.
Wordpress is a lingua franca for most content online, but the way it handles URLs internally is aggregious. My first
instinct was to host wordpress via nginx, using proxy_pass
and SSL termination
at nginx
. But wordpress decided to
act like a brashful teenager. Finally I caved and hosted wordpress with apache
on a /blog
subdomain here allround
blog.
The second part of the problem was running next.js
on the same host on the /
path. Apache has ProxyPass
, but my
first attempt wasn’t very succesful and after some researching (sic) on the internet, this was the final solution that
worked.
The trick was ProxyPass /blog !
which ensured that we can use apache for sublocation routing. On port 3001, next.js
was running supervisor
(my goto solution for running apps on a box).