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.
I don't know if this is the place to post this question, but i really hope someone have any idea how to fix it.
If this is not the place i will erase it
I have developed a site using Composite C1
I have uploaded it to my hosting provider "LiveDns"
I always logged out immediately after login to the admin area of the site
I have check the console, and i am getting the following error:
Failed to load resource: the server responded with a status of 403 (Forbidden)
top.js
Failed to load resource: the server responded with a status of 403 (Forbidden)
services/ConsoleMessageQueue/ConsoleMessageQueueServices.asmx
I have applied all proper folder permission...
Just to note, when i deployed it on my local IIS everything work just fine!
I have also used to work with Arvixe hosting provider and everything work smoothly
Any one have any clue?
I guess this is not a code problem but deployment problem...
At the end the hosting provider had to assign more memory and change the option to allow the site to run in Full trusted mode for this problem to be solved.
Nothing was wrong in the code
I've got 6 identical machines running IIS and Apache. Today one of them decided to just stop serving requests. I can access all of the webapps when I try from localhost/resource but when I try from url/resource I get a 404. I did a Get request against the machine that isn't working and I get this back:
Server: Microsoft-HTTPAPI/2.0
Connection: close
Compared to a working server:
Server: Microsoft-IIS/8.5
X-Powered-By: ASP.NET
Content-Type: text/html
Tried searching for this problem but came up with nothing, anyone got any idea's?
Windows has an HTTP service that manages calls to IIS and other HTTP enabled services on a windows machine. Either you need to configure it to handle your calls, or, in the case of WAMP or similar non-IIS-web-server-on-windows scenarios you may just need to turn it off.
When you see "Microsoft-HttpApi/2.0" returning error, such as 400 "bad URL" or "bad header", etc. the problem is most likely because the HTTP.sys service is intercepting your http request and terminating it because it does not meet with the minimum validation rules that are configured.
This configuration is found in the registry at HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters. In my case, it was choking because I had a RESTful call that had a 400 character segment in the url which was 160 characters more than the default value of 260, so I
added the registry parameter UrlSegmentMaxLength with a DWORD value of 512,
stopped the service using net stop http
started the service using net start http
I've run into these issues before and it is easy to troubleshoot but there is very little on the web that addresses it.
Try these links
"the underlying problem is that the client has sent a request to IIS that breaks one or more rules that HTTP.sys is enforcing"
enabling logging on HTTP.sys is described here
a list of the HTTP.sys parameters that you can control in the registry is found here.
A bit late, so put here for posterity ;-)
After trying all sorts of solutions found on the web, I almost gave up, but found this little nugget.
If the response's Server header returns Microsoft-HttpApi/2.0, it means that the HTTP.sys is being called, not IIS.
As a result, a lot of the workarounds will not work (URLScan, etc).
This worked however:
Open regedit
Navigate HKLM\SYSTEM\CurrentControlSet\Services\HTTP\Parameters\
If DisableServerHeader doesn't exist, create it (DWORD 32bit) and give it a value of 2. If it does exist, and the value isn't 2, set it to 2.
Finally, restart the service by calling net stop http then net start http
src: WS/WCF: Remove Server Header
Set below registry flag to: 2
HKLM\SYSTEM\CurrentControlSet\Services\HTTP\Parameters\DisableServerHeader
Setting this to 2 will ensure that self host WCF services no longer sends the SERVER header and thus ensure we are security compliant.
Please note that this disables ALL server headers.
The default value of 0 enables the header, and the value of 1 disables server header from DRIVER (http.sys), but app can still have headers.
For me I had to restart the server for the changes to take effect.
Hope this helps someone
I was working on our web app on a client's site and ran into an issue where the site root pages loaded, but the reports folder always returned a 404 for files that existed in the folder. The 404 page showed the .Net version of 2 when the application was set to 4, and a test of a non-existent page in the root returned a 404 page showing .Net 4.
I tried just http://localhost/reports and got back a Microsoft Reporting Services page. Not part of my application.
Be sure to check just the default document of the folder when a unexpected 404 comes up and the file exists.
This question and series of replies helped me get to the bottom of the related issue I was having. My issue centered around using just a subdomain to go to our server (e.g. typing "www/somepath" into the browser while on our corporate network), which had worked in the past on an older server, but no longer worked when the system was upgraded to a new server. I saw the unexpected Microsoft-HttpApi/2.0 string in the header when using the Chrome Devtools to inspect the Network traffic.
My HTTP.sys process was already logging, so I could verify that my traffic was going to that service and returning 404 NotFound status codes.
My resolution was to add a binding to the IIS site for the subdomain, making IIS respond instead of the HTTP.sys process, as described in this server fault article - https://serverfault.com/questions/479274/why-is-microsoft-httpapi-returning-404-to-my-network-switch
In my case, running Windows 10 Pro, it was the Windows MultiPoint Service.
By executing:
net stop wms
Port 80 was released.
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.
I'm using CC.NET 1.6 server and its corresponding CCTray connecting happily via remoting but need to change to use the dashboard connection via HTTP so that I can start farming the URL out to developers.
Putting my dashboard URL into CCTray:
http://localhost/CruiseControl/server/local/ViewServerReport.aspx
Results in CCTray returning
Failed to connect to server: The remote server returned an error: (500) Internal Server Error.
If I check my IIS logs, I can see the request was turned into a POST to this location and the log confirms the 500 response.
/CruiseControl/server/local/ViewServerReport.aspx/server/localhost/RawXmlMessage.aspx
If I navigate to that URL via GET - I get some Xml with error "Unable to process error: Root element is missing". This could be an artifact of me doing a GET instead of a POST of course.
Note: Yes I am using localhost in the URL as it is all contained on the one machine at the moment, if I can get this to work then I will of course change to use better hostname.
Worked this out after upgrading to cc.net 1.8
1) Check dashboard.config for server name
Use fiddler to watch the request go through and observe the dashboard server name
http://localhost/CruiseControl/server/yourdomain.com/ViewServerReport.aspx
In the above case it is yourdomain.com
Open your dashboard.config and make sure there is an entry with the same name
<server name="yourdomain.com" url="tcp://localhost:21234/CruiseManager.rem" allowForceBuild="true" allowStartStopBuild="true" backwardsCompatible="false" />
2) Check IIS request validation
Check your application pool for Cruise Control's IIS. If it is .NET 4.0 then you need this in your web.config
<httpRuntime requestValidationMode = "2.0" />
That config is sitting in cc.net 1.8 web.config but needs uncommenting
3) Try again, you should be good - if not observe responses in fiddler