RAILWAY_{serviceName}_STATIC_URL not working

I have an nginx container proxying to an application container and am trying to reference the application container url. The application container is named 'frontend' so I set an env variable equal to ${{RAILWAY_FRONTEND_STATIC_URL}} but it's coming through blank. What am I doing wrong here? product id: f44954e4-11aa-4f45-9e1a-302641b5dc42 using the 'separate-nginx' environment
Solution:
there's no need to set any variables yourself, just simply use RAILWAY_SERVICE_FRONTEND_URL assuming your frontend service is named "frontend"...
Jump to solution
10 Replies
Percy
Percy14mo ago
Project ID: f44954e4-11aa-4f45-9e1a-302641b5dc42
Solution
Brody
Brody14mo ago
there's no need to set any variables yourself, just simply use RAILWAY_SERVICE_FRONTEND_URL assuming your frontend service is named "frontend"
eggsovereasy
eggsovereasy14mo ago
yes it is
Brody
Brody14mo ago
this variable is created by railway, there's no need to add it yourself
eggsovereasy
eggsovereasy14mo ago
I made the intermediate variable just so i could quickly change values in railway and redeploy without having to do git commits and run it through that way. I have also tried without my own variable and it also did not work
Brody
Brody14mo ago
show me where you are using the variable
eggsovereasy
eggsovereasy14mo ago
nevermind, i just tried that again and it worked this time, maybe i had a typo the first time thank you
Brody
Brody14mo ago
haha no problem, another day another typo
eggsovereasy
eggsovereasy14mo ago
subquestion, if i name the service with a . in it do i just make that period an _ in the env var name, so site.com because RAILWAY_SITE_COM_STATIC_URL ?
Brody
Brody14mo ago
correct spaces, periods, commas, etc, all get normalized to a underscore and apha chars are always going to be uppercase