jimmy
Cloudflare Tunnel with Postgres DB
@Dane thanks for the hint, unfortunately just using
postgres:5432
in the public hostname configuration does not work.
Also i don't see how Cloudflare WARP can help me out on this.
All i need is just to access the db hosted on Railway without exposing it to the public, it seems i can't find a solution to this 😭13 replies
React + Vite + React Router - 404 on page reload.
basically the fix for the issue you have is that nginx does not resolves the reload path and you are required to change the server configuration for nginx. unfortunately this is not something Railway supports (for now).
the fix is to wrap the whole react app withing a docker container and run nginx into that container.
STEP 1:
Create a
Dockerfile
at the root of your project and add in it the following code:
Replace those ARG
with your env variables and if you use npm
replace where im using yarn
STEP 2:
Create .nginx/nginx.conf
file at the root of your project and add the following code:
STEP 3:
Add a .dockerignore
file at the root of your project and add the following code:
then all you have to do is to push repo to master and trigger deploy on Railway and the builder will automatically detect you have a Dockerfile
at the root of your project and will run the app with it.
Make sure to remove from Railway UI any start command (leave it empty).
NOTE: if you have setup a PORT
env variable in Railway UI please change the value to 80
so it matches with your nginx config file.
And it should work fine!7 replies