Accessing host different ports in production
in development, i can access the services with localhos:8080 (front end) and make request to the backend url with localhost:5678 (rails port).
but when i deploy this to production, wich has a domain name(www.websiteurl.com), i can view the front end but cant access the backen, i am unable to make any request.
i try to make requests to www.websiteurl.com:5678 and nothing happens, how can i access the backend port with a domain name?
ps1: Im sorry if the question is not clear enough, feel free to ask anything
ps2: I have correctly set up CORS access on the backend
ps3: if i access the production server via IP, it works correctly, the problem is when i access via the domain name
Command used to run front-end:
docker build -t runaterra:ekko . docker run -d \ -w /runaterra-ekko/ \ -p 80:8080 \ --name ekko \ --restart unless-stopped \ runaterra:ekko npm run dev
Command used to run backend:
docker-compose up -d --restart unless-stopped db docker-compose build app docker-compose run --rm app rake db:migrate docker-compose up -d --restart unless-stopped app
One Solution collect form web for “Accessing host different ports in production”
You didn’t expose port 5678 of your app to the internet.