Comments (16)
If you can reproduce the issue with an open source project I can look into it.
My "guess" is that you need to change your binding to 0.0.0.0
Regarding the HTTP auth, I believe it's a CloudFlare issue. They intercept the http request and manage the Basic Auth for you. You can disable the interception on CloudFlare interface by clicking on the orange cloud to turn it into a grey cloud.
from caprover.
@githubsaturn Seems like this needs to be document in FAQ. https://caprover.com/docs/troubleshooting.html#successful-deploy-but-502-bad-gateway-error
I spent an hour debugging this 502 error and using 0.0.0.0
seems to work.
from caprover.
The case you described works fine with Captain. Personally, I have multiple apps like that and they are all running fine.
So you're saying your static files (front end) loads fine but backend POST request results in 502? This should not be possible.
This seems to be your app bug,not Captain. You probably are not usi relative paths for your requests. Please provide a test app for further investigation. Alternatively, please include your webapp address so i can look into it.
from caprover.
Here are the simple code when user is authenticate.
The client side using Angular2:
authenticateUser(user) {
let headers = new Headers();
headers.append('Content-Type', 'application/json')
return this.http.post('api/login', user, {
headers: headers
}).map(res => res.json())
}
And for the server side (straightforward):
router.post('/api/login', authController.authenticate)
It must be the URI used in the client side api/login
that cause the error.
from caprover.
This is not a CaptainDuckDuck related question. This is specific to your app. CaptainDuckDuck forwards all requests to app.com
to your app without interfering with them.
To reopen, if you have a repro case, please upload a tarball file of your application that exhibits the problem.
from caprover.
This is happening on one of my captain apps and not the rest but here's the catch every third request is throwing a 502 error. I'm not sure what the root cause is because locally I can run my request at about 100 request /s but once deployed to my captain server It seems to fail every third request. I'm still investigating and this is the closing sounding to my case.
from caprover.
Have the same issue with AdonisJS deployment. It is running on 127.0.0.1:3333
I changed container http port to 3333 but still the same 502 error. I tried port mapping and still the same. I'm trying to fix this all freaking day lol, but nothing.
from caprover.
Are you sure that your app is actually running? 502 means that nginx cannot connect to your app. Wrong binding port is one of the potential problems. To resolve:
- First change container http port to 3333 (like you did)
- Next, verify that your application is actually running. Go to the deploy tab of your app and view the logs. Your app might be erroring and restarting or not starting up properly.
from caprover.
That's what it sais in application logs.
from caprover.
That's what it sais in application logs.
Are you saying in your application log you see 502 error? Can you please copy and paste your application logs here?
from caprover.
This is my application log:
2019-04-08T22:44:26.890354034Z
2019-04-08T22:44:26.890394993Z > [email protected] start /usr/src/app
2019-04-08T22:44:26.890401146Z > node server.js
2019-04-08T22:44:26.890405113Z
2019-04-08T22:44:27.265140778Z info: serving app on http://127.0.0.1:3333
from caprover.
One more thing, I tried adding HTTP Basic Auth and it asks for username and password and goes to cloudflare 502 page.
from caprover.
Changed host IP to 0.0.0.0
it works like a charm! Thank you!
from caprover.
Where do I need to change the host IP?
from caprover.
Where do I need to change the host IP?
in nginx configuration section
from caprover.
This did NOT work for me. Does anyone have any other suggestions?
from caprover.
Related Issues (20)
- MongoBD in CapRover App cannot connect from local machine HOT 2
- [Question] HOT 1
- Deploying from github does not read environment variable HOT 3
- Issue with using Redis app HOT 1
- [Question] Configure app CPU and Memory limits HOT 1
- View application logs from the CLI
- [Deployment Issue] Verification Failed HOT 5
- [Feature] Build from personal one click application git repository HOT 1
- Lobe-Chat One-Click App Deployment Help / New Add HOT 1
- [Question] Unable to access CapRover dashboard after domain expiration HOT 4
- Support Default Seettings for Containers
- OpenVPN fails enabling HTTPS HOT 3
- CapRover is no longer open source but still lists open source on the website and documentation. HOT 1
- CapRover isn't Open Source, and denies the Open Source Initiative's definition of it HOT 3
- Caprover not replicating new one click apps and not neither restarting HOT 2
- [Question] CertBot Docker container using a no longer supported version HOT 1
- directory index of "/app/" is forbidden [Question] HOT 4
- [Question] how to add mimtype? HOT 1
- Deploying Caprover - ARM SSL Error HOT 4
- [Deployment Issue] On Click App Strapi
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caprover.