- Newest
- Most votes
- Most comments
The issue you're experiencing with your API Gateway custom domain name not working as expected when adding a path in the API mappings is likely related to how you've configured your base path mappings.
When you set up a custom domain name in API Gateway, you can create base path mappings to connect specific paths of your custom domain to different API stages. However, it's important to understand how these mappings work:
-
The base path you specify in the mapping becomes part of the URL path for your API.
-
If you've set up a base path mapping with the path "test", requests to "https://services.myapp.com/test" will be routed to the root ("/") of your API.
-
In your case, when you're trying to access "https://services.myapp.com/test/v1/listingService", API Gateway is likely looking for a resource at "/v1/listingService" in the API stage mapped to the "test" base path, which probably doesn't exist.
To resolve this issue, you have a few options:
-
If you want to keep your current API structure, remove the base path from your custom domain mapping. This way, "https://services.myapp.com/v1/listingService" will work as before.
-
If you want to use the "test" path, you need to update your API structure to include the "test" path in your resource paths. For example, your API resource would need to be "/test/v1/listingService" instead of just "/v1/listingService".
-
Alternatively, you could create a new stage of your API with the desired base path structure and map it to the "test" path in your custom domain.
Remember to deploy your API after making any changes to ensure they take effect. Also, it may take some time for changes to propagate, so allow a few minutes before testing again.
If you're still encountering issues after trying these solutions, you may want to double-check your API Gateway configuration, ensuring that all mappings and integrations are set up correctly.
Sources
Custom domain names for HTTP APIs in API Gateway - Amazon API Gateway
Custom domain name for public REST APIs in API Gateway - Amazon API Gateway
Set up an edge-optimized custom domain name in API Gateway - Amazon API Gateway
Relevant content
- Accepted Answerasked 6 years ago
- asked 5 months ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 2 years ago