How do i host gatsby.js on a subdirectory using nginx, i have already tried to do this using proxy_pass http://127.0.0.1:8000
with gatsby develop
but i'm facing issues with Socket.io. Does anyone know how to host gatsby on a subdirectory i've tried using the following rewrite code rewrite ^([^.\?]*[^/])$ $1/ permanent
. But that does nothing.
Fix
Okay so at first i was using gatsby develop
so that i can make use of HMR, but i guess beggars can't be choosers, so based on what fabian said, i did the following.
Here is what i did, ultimately,
I added the line pathPrefix: '/blog'
on my gatsby-config.js
file
I ran gatsby build --prefix-paths
on the home directory of my project
And copied the contents on the public
folder moved to a folder called blog
in the root directory of my website and it works perfectly (without HMR, that's).