Intermittent 502 when using cloudflare on azure - azure

I am hosting my website on azure and using cloudflare for dns and proxy.
Recently I started experiencing a problem where if I refresh a page a number of times, eventually I get the cloudflare 502 page. Refreshing the page again and it loads fine.
If I refresh the page without using cloudflare, i.e. I go straight to {mydomain}.azurewebsites.net I don't get the issue.
So obviously the problem is server/cloudflare side config. Any ideas on what could be causing this?
I think it is related to this issue: https://community.cloudflare.com/t/random-502-errors-for-last-3-days-caused-by-illegal-request-header-injected-by-cf-reverse-proxy/202061

The 502 Bad Gateway error is an HTTP status code that means that one server on the internet received an invalid response from another server... so as it stands you don't have enough information to figure out what is going on here.
You will need to find a way to get the web server logs from your server on Azure and possibly also the logs from Cloudflare.

Related

Getting Error 503 when sending request via heroku or any host not local

my Node.js server is supposed to send a GET request to a third-party website vie https.get, but that website returns a 503 error, which is strange, because when I send the exact same request from my own device everything works as intended. Does anybody know what may be the cause of this problem, and how it can be fixed?
EDIT: The website uses CloudFlare, it might be related to theproblem but still - it works in my device.
Checking if the site connection is
shahed4u.vip needs to review the security of
If you are using cloudflare it's just normal, because cloudflare prevent access to bots.
Note: all informatical program making HTTP request are bots, is considered as "true clients" by cloudflare browsers with graphical instance, cookies, and algorythm (check this article on how cloudflare detect "bots")

Googlebot and Google Mobile bot Crawl Error after Domain IP and Domain DNS changed (Site not Reachable)

in past week I had to change my server to cloud (Digital Ocean Droplet), I am using a shared service but the concurrent user reached the number of Php execution (30). I shifted the entire site and site is up and running successfully, moreover Yandex and Bing are able to crawl my website but it is Google that I want.
I have got like 100K errors in console dashboard and raising, google ads bot isn't able to crawl my pages too. I have checked the following and there is no error in these.
.htaccess and redirections.
SSL
DNS records (I shifted name servers to DO and then back to registrar to see if the DNS was the error) but it doesn't seem like it is.
I double checked robots.txt it is fine by the google robots.txt validator and other search engines.
Similar setups are running on other servers with no changes at all the are fine.
UfW, I am new to it but due to its temporary nature I don't think it is the reason. I disabled it and checked it doesn't make difference.
I haven't blocked anything on apache so it should be good too.
The error that appears is attached at screenshots
Help me out as instead of scaling, I am going down bad.
I repointed the DNS through another service it took its time but it is resolved. I wasn't sure about the error, now I am, it is because of improper or partial DNS resolution issue.

502 WAF to Appservice connection issue (domain name fails and Azure name passes)

When we call domain url, www.foo.com it gives 502 error
"502 - Web server received an invalid response while acting as a
gateway or proxy server."
But the technical url www.foo.azurewebsites.net is working fine.
How do we diagnose this?
Since the technical url is working fine we can rule out application or code error
We ran a Diagnosis of WAF (pdf removed the spaces, sorry)
DegradedBackendServerHealth:ApplicationGateway:'FOO',BackendServer:'foo.azurewebsites.net',HealthStatus:Down,BackendservercertificateisnotwhitelistedwithApplication
Gateway.,Reportedat:7/14/20199:34:40AM.Mitigation:Reviewthehealthofthebackendserverfirst.Ifthebackend
serverishealthyandcanrespondwithHTTP200viaotheraccesspaths,troubleshootnetworkconnectivityfromthe
ApplicationGatewayinstancestothebackendserver.Troubleshootingincludes(butisnotlimitedto):SecurityRules,
routing,networkperformance,andgeneralTCPconnectivitytroubleshooting.
WehavefoundthatalltheinstancesofBackendAddressPoolareunhealthy.Ensurethattheinstancesarehealthyandthe
applicationisproperlyconfigured.Checkiftheback-endinstancescanrespondtoapingfromanotherVMinthesame
VNet.Ifconfiguredwithapublicendpoint,ensureabrowserrequesttothewebapplicationisserviceable.
We checked the certifcates configured, it is working fine
Pretty much all recommendation are verified and working fine
How can we diagnose this further and find rootcause?
It was resolved on slot swap. For some reason, one slot had some security restrictions in place. Not sure who did it or Why it was done. This is the immediate answer.
There seemed to have some script run which affected all live servers but the slots/staging were 'protected'. When the staging became production this issue was reverted(as they were 'protected')
Will update once more info available on this

Debugging ERR_CONNECTION_RESET error

Recently I started getting The connection was reset. error message (error code is ERR_CONNECTION_RESET) when I open one of my websites. This has nothing to do with application(node.js) level afaik as no changes or deploys were made in the application. To add to this, there were no error logs so I am assuming the request did not even receive the node app. The website is hosted on godaddy and its backend is a elastic beanstalk application. How do I fix this? On the web browser, in the second attempt it automatically loads correctly. But in a iframe which embeds my website, this has become a nasty issue as the browser does not even retry. I did the DNS analysis using dig command and all that but could not find anything relevant. Interesting part is this only happens after some interval (it does not happen continuously). On reload it works without fail.

How to customize 502 page in Node.Js?

When I try to access my URL running a Node.js app, when the app not running, the page shows
502 – Bad Gateway
The page you requested is currently unavailable. Please try again
later.
If you are the website owner, please see Error: 502 Bad Gateway
documentation for more information and possible steps to resolve the
problem.
It's hosted on webfaction.
Is there a way to customize what shows on this page?
This error isn't caused by node.js; it is caused by a proxy between you and node.js. This may mean that your server isn't running. Try contacting webfaction.

Resources