Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Comments on org.apache.http.NoHttpResponseException: nginx.apps.cloud.cloud.local:443 failed to respond
Post
org.apache.http.NoHttpResponseException: nginx.apps.cloud.cloud.local:443 failed to respond
+1
−0
Getting the following error only when I call a post API through Nginx
[0m[31m12:48:35,903 ERROR [io.acurio.hub.api.rest.impl.DesignsResource] (default task-16) Failed to invoke workflow: com.mashape.unirest.http.exceptions.UnirestException: org.apache.http.NoHttpResponseException: nginx.apps.cloud.cloud.local:443 failed to respond
at deployment.acurio-studio-api.war//com.mashape.unirest.http.HttpClientHelper.request(HttpClientHelper.java:143)
at deployment.acurio-studio-api.war//com.mashape.unirest.request.BaseRequest.asString(BaseRequest.java:56)
at deployment.acurio-studio-api.war//io.acurio.hub.api.rest.impl.DesignsResource.initiateWorkflow(DesignsResource.java:597)
at deployment.acurio-studio-api.war//io.acurio.hub.api.rest.impl.DesignsResource.createDesign(DesignsResource.java:472)
at deployment.acurio-studio-api.war//io.acurio.hub.api.rest.impl.DesignsResource$Proxy$_$$_WeldClientProxy.createDesign(Unknown Source)
at jdk.internal.reflect.GeneratedMethodAccessor584.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.jboss.resteasy.resteasy-jaxrs@3.7.0.Final//org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:138)
at org.jboss.resteasy.resteasy-jaxrs@3.7.0.Final//org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:517)
at org.jboss.resteasy.resteasy-jaxrs@3.7.0.Final//org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:406)
at org.jboss.resteasy.resteasy-jaxrs@3.7.0.Final//org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$0(ResourceMethodInvoker.java:370)
at org.jboss.resteasy.resteasy-
Here is the POST api url :
Here is my location in nginx
location /api-hub/ {
proxy_pass http://acuriostudi.apps.cloud.local/api-hub/;
# Simple requests
if ($request_method ~* "(GET|POST)") {
add_header "Access-Control-Allow-Origin" *;
}
# Preflighted requests
if ($request_method = OPTIONS ) {
add_header "Access-Control-Allow-Origin" *;
add_header "Access-Control-Allow-Methods" "GET, POST, OPTIONS, HEAD";
add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Requested-With, Content-Type, Accept";
return 200;
}
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_request_headers on;
limit_except GET PUT POST DELETE OPTIONS { deny all; }
override_charset on;
server_tokens off;
charset UTF-8;
source_charset UTF-8;
#add_header 'Content-Type' 'application/json; charset=UTF-8';
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header Cache-Control "no-cache no-store private";
#add_header Access-Control-Allow-Methods "GET, PUT, POST";
#add_header 'Access-Control-Allow-Methods' 'GET,PUT, POST, OPTIONS';
#add_header Access-Control-Allow-Headers "X-Custom-Software, X-My-Custom";
proxy_cookie_path / "/; SameSite=None; HTTPOnly; Secure";
proxy_hide_header X-Upstream;
#proxy_hide_header Content-Type;
expires $expires;
#add_header Access-Control-Allow-Origin "agtest.ad.infosys.com" always;
#add_header Access-Control-Allow-Headers "X-Custom-Software, X-My-Custom";
keepalive_timeout 3600;
proxy_connect_timeout 300;
proxy_read_timeout 300;
proxy_send_timeout 300;
}
2 comment threads