deploying springboot backend but no HTTPS public link
orangeuaswe
FREEOP

6 months ago

hi there, im a bit new to deploying on services like railway, and im trying to deploy a springboot backend on railway, and it does work, but the issue is with cross-origins. my frontend is a https site, whereas the public link we get with railway is an http link. is there any way to remedy this, or am i SOL?

$10 Bounty

28 Replies

6 months ago

The public link should not be an HTTP link. What button are you pressing to generate it?


6 months ago

If you own a domain you should use that for both the frontend and backend, with the backend having a subdomain. (For example backend.example.com)


6 months ago

If not then you can press the generate domain button and that will give you a usable HTTPS link


orangeuaswe
FREEOP

6 months ago

i do have a domain i own, and i'm currently hosting my frontend on netlify


6 months ago

Perfect


orangeuaswe
FREEOP

6 months ago

i bought the domain from namecheap, and i'm using their nameservers instead of namecheaps


6 months ago

Vercel's nameservers?


orangeuaswe
FREEOP

6 months ago

netlify


6 months ago

I would just use Cloudflare here


6 months ago

I didn't even know Netlify had nameservers


orangeuaswe
FREEOP

6 months ago

i just made a cloudflare account


orangeuaswe
FREEOP

6 months ago

would it be easier to just host it on there?


orangeuaswe
FREEOP

6 months ago

there's not much its doing


6 months ago

The domain? Yes.


orangeuaswe
FREEOP

6 months ago

ok so i was able to host my domain on cloudflare, just waiting on it to change nameservers and stuff


6 months ago

Hoorah


orangeuaswe
FREEOP

6 months ago

so i setup subdomains on cloudflare, and then link it to railway?


6 months ago

Yeah


6 months ago

Go into the backend's service settings and use backend.example.com


6 months ago

It'll instruct you


6 months ago

Then on your frontend you can call backend.x


orangeuaswe
FREEOP

6 months ago

gotcha


orangeuaswe
FREEOP

6 months ago

waiting on the dns to update


orangeuaswe
FREEOP

6 months ago

so once its all done, its up and ready to go?


6 months ago

It should be yes 😁


6 months ago

The name servers might take a few hours to update but over all it'll work!


6 months ago

Yerp! Should be basically instant with Cloudflare as well.


6 months ago

@oncle97 Did you get this working?


Loading...