R
Railway11mo ago
daemon

Nginx starter template not responding

Hi, I've set up a dead simple deployment that looks identical to https://github.com/railwayapp-templates/nginx. I have a bigger repo with a lot of crap in it but one folder that's super simple, literally just a bit of static html
.
├── Dockerfile
└── site
└── index.html
.
├── Dockerfile
└── site
└── index.html
which matches the docker example. the app appears to build just fine and deploy fine curl -vvv yields HTTP/1.1 301 Moved Permanently which is odd. I am using a railway.app subdomain for public access. I disabled and reenabled a new one to rule out bugginess there. I have disabled private networking. I just want to put one html file on the internet quickly am I missing something obvious?
No description
14 Replies
Percy
Percy11mo ago
Project ID: N/A
Brody
Brody11mo ago
send a link to your public domain please
daemon
daemonOP11mo ago
workflow-demo-frontend-production.up.railway.app (woops, curl http://... yields 503, which sounds right, but still not loading the website)
Brody
Brody11mo ago
1. you need to use https 2. what port does nginx listen on?
daemon
daemonOP11mo ago
right, I meant that. I've just set env var PORT to 80, nginx's default, let's try that
Brody
Brody11mo ago
perfect
daemon
daemonOP11mo ago
the dockerfile is just
FROM nginx:alpine
COPY site /usr/share/nginx/html
FROM nginx:alpine
COPY site /usr/share/nginx/html
and that did the trick thanks!
Brody
Brody11mo ago
no problem!
daemon
daemonOP11mo ago
might I suggest in the official template including an nginx.conf that is set to port 80 by default?
Brody
Brody11mo ago
the official template comes with a PORT service variable set to 80
daemon
daemonOP11mo ago
I know it's a 2 year old template and there's prob been some changes to the port autodetection or something ah
Brody
Brody11mo ago
railway also does not do any port auto detection
daemon
daemonOP11mo ago
i see that
No description
Brody
Brody11mo ago
you are not the first to have this problem, there is a whole docs page on it https://docs.railway.app/guides/fixing-common-errors
Want results from more Discord servers?
Add your server