Apache : Request Out Limit - api

In apache server, there is any setting which is stands for Request Out Limit?
Example : I am requesting 1000 third party API call from my live server. It's taking too much time to get response. Same API call, I am trying from my local server and getting very quick response.
I have tried with making call using curl in both local and production server.
Restarted apache server.

Related

frontend cloud run app can not access my backend cloud run app due a MixedContent problem

I have two cloud services up and running.
frontend (URL: https://frontend-abc-ez.a.run.app/)
backend (URL: http://backend-abc-ez.a.run.app/)
Frontend is calling the backend through a nuxt.js server middleware proxy to dodge the CORS problematics.
The call is coming through - I can see that in the backend log files. However the response is not really coming back through because of CORS. I see this error in the console:
Mixed Content: The page at 'https://frontend-abc-ez.a.run.app/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://backend-abc-ez.a.run.app/login'. This request has been blocked; the content must be served over HTTPS.
What I find weird is that I configured the backend url with https but it is enforced as http - at least that is what the error is telling me. Also I see a /login path segment in the unsecure URL. Why is that? I never explicitly defined that endpoint. Is it the security layer proxy of the run service itself?
Anyway - I need to get through this properly and am having a hard time to understand the source of the problem.
For some reason as I rechecked the applications today in the morning everything went fine. I have really no idea why it is working now. I did not change a thing - I waited for the answers here before I'd continue.
Very weird. But the solution so far seems to be waiting. Maybe Cloud Run had some troubles.

Ngrok and webhooks

I got a problem on my app, and i'm newbie on this tehcnology ...
I have an express app on a heroku url (https://my-website.heroku.com)
I've also this project on a localhost. I want to use the prismic webhook to do some stuff when a document is published.
I try to use ngrok to:
connect it to the heroku website
detect when my /webhook route is called on the heroku app to dispatch it on my localhost server (which is the same project, but I don't know how to do this with ngrok (I used some commands but nothing happen :/ )
Can you help me please ? Thank you !
I might be misunderstanding your use case, but it sounds like what you're wanting to do is handle or detect an incoming request to your heroku app and then proxy or forward that request to your localhost.
One way to handle this would be to -- in response to the original event or request -- then make a second request like a POST request to the Ngrok URL linked to your localhost machine from your heroku app. Ngrok itself is not a real proxy server, it just links two instances of URL/DOMAIN:PORT to each other where one of these runs in the Ngrok cloud service.
So in the code you have handling or receiving the webhook request on the heroku app, you could there make, say, a POST request to the Ngrok URL for your localhost and that request would be forwarded to your localhost machine. I'm not sure what data or information you want to see in localhost but you could pass along any incoming request data in the POST body to your localhost Ngrok URL and then see the same data locally.

Issue with request body in OPTIONS or DELETE request with google load balancer

My server side setup is like this : I have a google compute engine instance running nodejs server. It sits behind https load balancer.
So the issue is that if OPTIONS type request is sent with body(payload) to load balancer ip, it sometimes fail with 502. I have checked that in all these requests, node server is returning and logging correct responses. It works perfect if the request body is left empty.
However, when I directly hit GCE's ip, it works fine whether or not request body is there or not.
For e.g
this is the load balancer ip (with ssl enabled)
OPTIONS https://130.211.14.60/health
this is the direct GCE machine ip (without ssl)
OPTIONS http://104.199.159.212:8002/health
I have checked by sending requests multiple times(literally hundreds of times) using Postman app.
And this issue is only with DELETE and OPTIONS type requests. GET/POST/PUT works perfectly fine.
Is there anyone who can point me what the issue could be and how to solve it.
From Google's docs -
The HTTP(S) load balancer does not support sending an HTTP DELETE with a body to the load balancer. Such requests will receive an error message: Error 400 (Bad Request)!! Your client has issued a malformed or illegal request. Only DELETE requests without bodies are supported.
More info here.
This feature is now supported by Google Load Balancer, released in Dec '18.
More info here.

How to solve HTTPS response 498 when googlebot comes along?

I have an AJAX site leuker.nl and when googlebot comes along the site is started and it will retrieve an XML file from my backend server that contains site text.
The HTTP GET request used to retrieve the file returns a HTTP error 498.
Looking on LINK it explains that is concerns an invalid/expired token (esri) returned by "ArcGIS for Server".
I don't understand this error, I don't even use ArcGIS and never heard of it before.
Andy idea how to solve this?
In the backend I use Apache Httpd 2.4 in combination with Tomcat 8.0. Apache proxy requests to Tomcat through an ajp connector. The XML file requested is directly returned by Apache.

How to get domain name for request coming through web server?

I have 2 domains. http://sender.com/someServlet/ and http://receiver.com/someReceiver.
someServlet will POST some data to someReceiver. Flow is like below,
sender.com -> Apache web server of receiver.com -> Application server of receiver.com
I want to get the domain who is posting the data to receiver.com's someReceiver servlet.
Since, there is a Apache web server through which the request has to go through,
when I execute below code in someReceiver servlet, I am getting the domain of
receiver.com instead of sender.com.
request.getServerName();
This post tells to do configurations to support getServerName(); to return the actual
sender's domain. Am not sure what configurations has to be done.
How can I get the actual domain who is posting the data?