Caddy with Cloudflare 502 bad gateway error - cloudflare

I have app running on port - 3000 and running with caddy reverse proxy at port 80 and 443.
It works fine, but as soon as I switch to cloudflare, the site gets down and shows error 502 bad gateway

I just got this solved by installing tls.dns.cloudflare plugin.

Related

400 Bad Request load balancer for Apache servers with NGINX

I am using NGINX as load balancer for Apache WebServers (WordPress). All servers are made with AWS EC2. My config for NGINX:
cat /etc/nginx/sites-available/default
upstream web_backend {
server 35.157.101.5;
server 35.156.213.23;
}
server {
listen 80;
location / {
proxy_pass http://web_backend;
}
}
But after NGINX restart i am access load balancer via public ip and getting an error:
Bad Request
Your browser sent a request that this server could not understand.
Additionally, a 400 Bad Request error was encountered while trying to
use an ErrorDocument to handle the request.
Apache/2.4.29 (Ubuntu) Server at
ip-172-31-35-36.eu-central-1.compute.internal Port 80
If i refresh page i am getting same error but with another ip in the end (second server’s private ip), so i understand that NGINX do the work and it is Apache problem.
I tried to add 80 port for my servers in nginx config, replace ips with dns and private ip, but it didn’t help. Access log on Apache doesn’t show anything useful, just 400 errors.
What could be the problem?
Don’t use ‘_’ for upstream name, it was the only reason for my problem.
Just check on which ports are the Apache WebServers Running. You have to add those to your upstreams.
E.g.:
upstream web_backend {
server 35.157.101.5:8080; //assuming that your apache webserver is running on this port on this host
server 35.156.213.23:3000;//And a different port on the other.. you still need to add them here if your ports are same
}

Nginx and Apache 2

My application deployed on apache2 in Ubuntu and I am routing it through nginx with domain name it shows me websocket error handshake error 503 service unavailable error it could worked or not?

How to configure HAProxy according request based on ports?

Here we are using haproxy for the redirection of HTTP to https, at backend we use the gateway. here gateway having already ssl certificate we redirected to it directly through HAProxy.
We have 2 URL one hit on port 80 and 2nd hit on port 8080 what are the possible conditions required for that have tried all possibilities. without using SSL it's working but regarding to the SSL it can't work it only work on 443 and its only applicable to the port 80 not getting assign to others.

Apache throws 502 bad gateway after some time

I'm using Ubuntu 16.04 with Plesk. After some time that everything has been okay, all the webpages from Plesk throw 502 bad gateway errors for no obvious reason. As soon as I type the command service apache2 restart, everything's alright again.
Oddly, it states
502 Bad Gateway
nginx
despite using Apache instead of nginx.

HAProxy check backend on 2 ports

we have apache in front of tomcat. it happens that the tomcat crashes and the apache still serve the webpage with a 503 page.
there's a way, via HAProxy to check both ports: 80 and 8080 and then bring the node up?
I added the http-check expect rstatus (2|3)[0-9][0-9] and the http-check expect ! rstatus ^5 but none of the 2 detected that tomcat was unreachable while the apache was providing the service.
thank you a lot
Nick
If your health check is configured correctly, you don't have to test both ports -- just configure the health check to send a request to apache that will be served by tomcat, using option httpchk. A 503 response will cause cause that server to be declared unhealthy.
the problem was the / at the end that did a redirect. once modified, works correctly with the expect 200.