API Gateway Content Type issue
Hi Team , We wanted to expose PingAccess Console via APIGateway.
We have below flow : Internet --> AWS API Gateway --> Private NLB --> EC2(Hosted PingAccess Admin Console)
We have deployed AWS API Gateway REST API with proxy integration and VPC link configuration but we are no able to open the same using API Gateway Endpoint.
We are getting below error in Browser.
Refused to apply style from 'https://pingaccess.dev.obiebank.obly.io/dist/styles.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
We have added Content-Type
in Response Headers
and remove application/json
from Content-Type
option in Method Response
tag.
Note: We are able to open PingAccess Console from NLB , with creating Public NLB.
Are you using Proxy Resource?
Seems like your issue is that API gateway is not forwarding the URL path to NLB, so your backend is always returning the content of https://pingaccess.dev.obiebank.obly.io/
(which most likely is an HTML page)
If you don't want to specify all possible URL path in the API gateway, using proxy resource is the way to capture all URL suffix and forward to the backend.
https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-up-simple-proxy.html
Relevant questions
API Gateway Private Integration with multiple NLB listeners
Accepted Answerasked 3 years agoHow to get traffic from a public API Gateway to a private one?
Accepted Answerasked a day agoAPI Gateway API Mappings deployed through CDK do not work until modified via console
asked 3 months agoPrivate API Gateway static IP
asked a month agoBuild a REST API with API Gateway private integration: Tutorial
Accepted Answerasked 4 months agoAWS Api Gateway: how to expose new services automatically?
asked 4 months agoAmazon API Gateway Proxy - VPC Endpoint - NLB - Private DNS - Self-signed SSL
Accepted Answerasked 2 years agoPrivate Route 53 to API Gateway
Accepted Answerasked 7 months ago{"message":"forbidden"} when accessing private API Gateway
asked 2 years agoAPI Gateway Content Type issue
asked 23 days ago
Hi RichardFan , Thanks for responding. YES, we are using Proxy resource and we have mention greedy Proxy path
{proxy+}
to handle all context paths.