Caddy proxy connection refused

I have a problem with the reverse proxy, I set the backend and frontend to listen on port 3000 I use railway reverse proxy variables (2 photos) but it gives me an error that rejects the connection (3 photos) Project ID : 5da60841-1f6c-4e52-a848-3130a3b8ab8e
No description
No description
No description
Solution:
1. remove the build and start commands you have set in the service settings. 2. https://github.com/brody192/create-react-app-starter - copy the nixpacks.toml and Caddyfile from this repo into yours....
Jump to solution
16 Replies
Percy
Percy3mo ago
Project ID: 5da60841-1f6c-4e52-a848-3130a3b8ab8e
Alejandro Capra
Alejandro CapraOP3mo ago
In mi backend i use express:
console.log("Server on");
const port = Number(process.env.PORT) || 3000;

return app.listen(port, "::", () => {
console.log(`Server listening on [::]${port}`);
});
console.log("Server on");
const port = Number(process.env.PORT) || 3000;

return app.listen(port, "::", () => {
console.log(`Server listening on [::]${port}`);
});
Alejandro Capra
Alejandro CapraOP3mo ago
No description
Alejandro Capra
Alejandro CapraOP3mo ago
in my frontend , i crete a domain and its working
No description
Alejandro Capra
Alejandro CapraOP3mo ago
No description
Alejandro Capra
Alejandro CapraOP3mo ago
how can i fixed? Fun fact: I had to use in the packagejson in the backend "build": "rm -rf ./dist && tsc || true", and in the frontend "build": "react-scripts build || true", Why would the build stop if it had errors, even if my tsconfig was:
"compilerOptions": {
"noEmitOnError":` false,
"compilerOptions": {
"noEmitOnError":` false,
its a mono repo
MantisInABox
MantisInABox3mo ago
When you are referencing something on the private network, you need the URL to be <internal domain>:port number so, for your example, your frontend_domain should be app-frontend.railway.internal:3000 and your caddy config should reference the variable
Alejandro Capra
Alejandro CapraOP3mo ago
This caddy repo asks you for it separately, I tried the older one that was like that and it doesn't work
Alejandro Capra
Alejandro CapraOP3mo ago
No description
Brody
Brody3mo ago
yep the template does ask for the domain and port as separate variables.
Alejandro Capra
Alejandro CapraOP3mo ago
in think i fixed its deploying i was a error with serve, not sure in a few minutes i discover
Brody
Brody3mo ago
the issue here is that your frontend is not listening on ipv6.
Alejandro Capra
Alejandro CapraOP3mo ago
is the deploy is succes yes i use serve
Brody
Brody3mo ago
you would want to be using caddy
Solution
Brody
Brody3mo ago
1. remove the build and start commands you have set in the service settings. 2. https://github.com/brody192/create-react-app-starter - copy the nixpacks.toml and Caddyfile from this repo into yours.
Want results from more Discord servers?
Add your server