FastAPI refuse to connect request from Kong Gateway - fastapi

I want to access to my FastAPI application for image prediction. After configuring the Kong gatway, I am able to see the services / routes but cannot access to the service by Insomnia.
Please check the screen shots.
KONG LOGS :
KONG LOGS
Insomnia output : bad gateway
INSOMNIA OUTPUT - BAD GATEWAY
FastAPI dashbord:
FastAPI dashbord
Fast API application running:
my app running and no receive requests
I tried to check if the API is accessible by link directly by browsing http://127.0.0.1:8080/predict/image but no response. But the CURL command works curl -X 'POST'
'http://127.0.0.1:8080/predict/image' but giving resposne as bad request.

Related

Cannot send request from Postman via my IP

Strange thing - I have host API on localhost it works proper (via browser). It's a part of bigger project.
I use Postman for testing endpoints, and when I make request via localhost or 127:
-https://localhost:7257/esp32
-https://127.0.0.1:7257/esp32
Postman gives me Status 200 OK and fine data from API, but if I send request via my IP adress:
-https://192.168.8.xxx:7257/esp32 then I see error like this: Error: connect ECONNREFUSED 192.168.8.xxx:7257
What does it cause? Is it correct or no?
Ok, I need to host my application on the outside.

NGINX HTTP 502, but only on one laptop

I am running an Nginx Ingress Controller and an Nginx reverse proxy in my Kubernetes cluster.
I started seeing an issue for just one user and it only started recently. That user keeps getting HTTP 502 from our Nginx.
When I send the same requests from my machine, they return HTTP 200. I also logged into the console of my NGINX container, and was able to execute the request that the redirect results in.
How else can I check the reason for HTTP 502? Are the responses from the address that I am redirected to visible anywhere?

Does AWS API Gateway enable https by default?

How to ensure all inbound requests made through aws api gateway are safe and using https/tls protocol ? I heard that aws api gateway enable https by default but when I test my request as a simple http request, that just executes normally.
Any suggestion ?

Nginx client sent duplicate header line?

I have a gateway where a request comes from a browser that makes a request for a microservice. Microservice makes a request after back to the gateway.
All this communication takes place within the framework of one connection. In all this communication, the same Authorization header.
Schematically there is the following chain of calls:
Browser -> API Gateway -> Microservice
|
-> API Gateway (from microservice)
nginx gives me 400 bad request, in the logs the following error:
2018/06/20 23:05:15 [info] 22615#22615: *35468 client sent duplicate header line: "Authorization: Access-Token: 123213213213213", previous value: "Authorization: Access-Token: 123213213213213" while reading client request headers
I mean some sort of check for the uniqueness of the headers ... But does it really take into account the subquery application that goes back from the service to the Gateway API in the first NGINX session with the Gateway API?

Capturing SOAP message on localhost using Fiddler

I am unable to capture local HTTP traffic when my Java client makes a SOAP request to my local Tomcat instance.
My current configuration is
Tomcat instance - run on localhost:8080
Local Java client - run from Windows cmd line
Fiddler - run on localhost:8888
I used Axis2 wsdl2java to create my client SOAP stub, and used my machines IP address when specifying the WSDL (hosted on Tomcat)
wsdl2java -uri http://192.168.0.5:8080/axis2/services/Version?wsdl -p sample.axisversion -d adb -s
So, the generated code has lines like this throughout:
public VersionStub(org.apache.axis2.context.ConfigurationContext configurationContext) throws org.apache.axis2.AxisFault {
this(configurationContext,"http://192.168.0.5:8080/axis2/services/Version.VersionHttpSoap12Endpoint/" );
}
My client app uses the generated stub and I set the Java proxy to Fiddler using the following code (which gets called before the SOAP stub is actually used):
System.getProperties().put("proxySet", "true");
System.getProperties().put("proxyHost", "localhost");
System.getProperties().put("proxyPort", "8888");
...but still I don't see any request or response traffic in Fiddler. What's missing?
Instead of localhost, try to use ipv4.fiddler, which makes sure your localhost traffic goes through fiddler. See also: http://www.fiddler2.com/Fiddler/Help/hookup.asp#Q-LocalTraffic

Resources