AWS ALB routing - Requested url not found
I have a Microservice dedicated as the front-end of an admin area of a website. The Microservice has a route dedicated to it, /admin
. Which is giving me a 404 error
when I'm trying to access. Given below is an extract from the cloud template of the Microservice.
Resources:
Service:
Type: AWS::ECS::Service
DependsOn: ListenerRule
Properties:
Cluster: !Ref Cluster
Role: !Ref ServiceRole
DesiredCount: !Ref DesiredCount
TaskDefinition: !Ref TaskDefinition
LoadBalancers:
- ContainerName: "activity-monitor-service"
ContainerPort: 80
TargetGroupArn: !Ref TargetGroup
TaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
Family: activity-monitor-service
ContainerDefinitions:
- Name: activity-monitor-service
Essential: true
Image: registry.hub.docker.com/abameerdeen/activity_monitor:v4
Memory: 128
Environment:
- Name: PRODUCT_SERVICE_URL
Value: !Ref ProductServiceUrl
PortMappings:
- ContainerPort: 80
LogConfiguration:
LogDriver: awslogs
Options:
awslogs-group: !Ref CloudWatchLogsGroup
awslogs-region: !Ref AWS::Region
CloudWatchLogsGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Ref AWS::StackName
RetentionInDays: 365
TargetGroup:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
Properties:
VpcId: !Ref VPC
Port: 80
Protocol: HTTP
Matcher:
HttpCode: 200-299
HealthCheckIntervalSeconds: 10
HealthCheckPath: /test.html
HealthCheckProtocol: HTTP
HealthCheckTimeoutSeconds: 5
HealthyThresholdCount: 2
ListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Properties:
ListenerArn: !Ref Listener
Priority: 2
Conditions:
- Field: path-pattern
Values: [ "/admin/*" ]
Actions:
- TargetGroupArn: !Ref TargetGroup
Type: forward
I have an Application Load Balancer (ALB) in the infrastructure too. Here is my project : https://github.com/ammarisme/aws-cloudformation.git
amazon-web-services aws-application-load-balancer
add a comment |
I have a Microservice dedicated as the front-end of an admin area of a website. The Microservice has a route dedicated to it, /admin
. Which is giving me a 404 error
when I'm trying to access. Given below is an extract from the cloud template of the Microservice.
Resources:
Service:
Type: AWS::ECS::Service
DependsOn: ListenerRule
Properties:
Cluster: !Ref Cluster
Role: !Ref ServiceRole
DesiredCount: !Ref DesiredCount
TaskDefinition: !Ref TaskDefinition
LoadBalancers:
- ContainerName: "activity-monitor-service"
ContainerPort: 80
TargetGroupArn: !Ref TargetGroup
TaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
Family: activity-monitor-service
ContainerDefinitions:
- Name: activity-monitor-service
Essential: true
Image: registry.hub.docker.com/abameerdeen/activity_monitor:v4
Memory: 128
Environment:
- Name: PRODUCT_SERVICE_URL
Value: !Ref ProductServiceUrl
PortMappings:
- ContainerPort: 80
LogConfiguration:
LogDriver: awslogs
Options:
awslogs-group: !Ref CloudWatchLogsGroup
awslogs-region: !Ref AWS::Region
CloudWatchLogsGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Ref AWS::StackName
RetentionInDays: 365
TargetGroup:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
Properties:
VpcId: !Ref VPC
Port: 80
Protocol: HTTP
Matcher:
HttpCode: 200-299
HealthCheckIntervalSeconds: 10
HealthCheckPath: /test.html
HealthCheckProtocol: HTTP
HealthCheckTimeoutSeconds: 5
HealthyThresholdCount: 2
ListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Properties:
ListenerArn: !Ref Listener
Priority: 2
Conditions:
- Field: path-pattern
Values: [ "/admin/*" ]
Actions:
- TargetGroupArn: !Ref TargetGroup
Type: forward
I have an Application Load Balancer (ALB) in the infrastructure too. Here is my project : https://github.com/ammarisme/aws-cloudformation.git
amazon-web-services aws-application-load-balancer
add a comment |
I have a Microservice dedicated as the front-end of an admin area of a website. The Microservice has a route dedicated to it, /admin
. Which is giving me a 404 error
when I'm trying to access. Given below is an extract from the cloud template of the Microservice.
Resources:
Service:
Type: AWS::ECS::Service
DependsOn: ListenerRule
Properties:
Cluster: !Ref Cluster
Role: !Ref ServiceRole
DesiredCount: !Ref DesiredCount
TaskDefinition: !Ref TaskDefinition
LoadBalancers:
- ContainerName: "activity-monitor-service"
ContainerPort: 80
TargetGroupArn: !Ref TargetGroup
TaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
Family: activity-monitor-service
ContainerDefinitions:
- Name: activity-monitor-service
Essential: true
Image: registry.hub.docker.com/abameerdeen/activity_monitor:v4
Memory: 128
Environment:
- Name: PRODUCT_SERVICE_URL
Value: !Ref ProductServiceUrl
PortMappings:
- ContainerPort: 80
LogConfiguration:
LogDriver: awslogs
Options:
awslogs-group: !Ref CloudWatchLogsGroup
awslogs-region: !Ref AWS::Region
CloudWatchLogsGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Ref AWS::StackName
RetentionInDays: 365
TargetGroup:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
Properties:
VpcId: !Ref VPC
Port: 80
Protocol: HTTP
Matcher:
HttpCode: 200-299
HealthCheckIntervalSeconds: 10
HealthCheckPath: /test.html
HealthCheckProtocol: HTTP
HealthCheckTimeoutSeconds: 5
HealthyThresholdCount: 2
ListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Properties:
ListenerArn: !Ref Listener
Priority: 2
Conditions:
- Field: path-pattern
Values: [ "/admin/*" ]
Actions:
- TargetGroupArn: !Ref TargetGroup
Type: forward
I have an Application Load Balancer (ALB) in the infrastructure too. Here is my project : https://github.com/ammarisme/aws-cloudformation.git
amazon-web-services aws-application-load-balancer
I have a Microservice dedicated as the front-end of an admin area of a website. The Microservice has a route dedicated to it, /admin
. Which is giving me a 404 error
when I'm trying to access. Given below is an extract from the cloud template of the Microservice.
Resources:
Service:
Type: AWS::ECS::Service
DependsOn: ListenerRule
Properties:
Cluster: !Ref Cluster
Role: !Ref ServiceRole
DesiredCount: !Ref DesiredCount
TaskDefinition: !Ref TaskDefinition
LoadBalancers:
- ContainerName: "activity-monitor-service"
ContainerPort: 80
TargetGroupArn: !Ref TargetGroup
TaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
Family: activity-monitor-service
ContainerDefinitions:
- Name: activity-monitor-service
Essential: true
Image: registry.hub.docker.com/abameerdeen/activity_monitor:v4
Memory: 128
Environment:
- Name: PRODUCT_SERVICE_URL
Value: !Ref ProductServiceUrl
PortMappings:
- ContainerPort: 80
LogConfiguration:
LogDriver: awslogs
Options:
awslogs-group: !Ref CloudWatchLogsGroup
awslogs-region: !Ref AWS::Region
CloudWatchLogsGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Ref AWS::StackName
RetentionInDays: 365
TargetGroup:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
Properties:
VpcId: !Ref VPC
Port: 80
Protocol: HTTP
Matcher:
HttpCode: 200-299
HealthCheckIntervalSeconds: 10
HealthCheckPath: /test.html
HealthCheckProtocol: HTTP
HealthCheckTimeoutSeconds: 5
HealthyThresholdCount: 2
ListenerRule:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Properties:
ListenerArn: !Ref Listener
Priority: 2
Conditions:
- Field: path-pattern
Values: [ "/admin/*" ]
Actions:
- TargetGroupArn: !Ref TargetGroup
Type: forward
I have an Application Load Balancer (ALB) in the infrastructure too. Here is my project : https://github.com/ammarisme/aws-cloudformation.git
amazon-web-services aws-application-load-balancer
amazon-web-services aws-application-load-balancer
asked Jan 1 at 4:24


Ammar Ibnu AmeerdeenAmmar Ibnu Ameerdeen
4401316
4401316
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Above ListenerRule
matches files inside the admin folder (eg :- index.html) not the path /
. So, I added the missing ListenerRule
as given below.
ListenerRule2:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Properties:
ListenerArn: !Ref Listener
Priority: 3
Conditions:
- Field: path-pattern
Values: [ "/admin" ]
Actions:
- TargetGroupArn: !Ref TargetGroup
Type: forward
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53992995%2faws-alb-routing-requested-url-not-found%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Above ListenerRule
matches files inside the admin folder (eg :- index.html) not the path /
. So, I added the missing ListenerRule
as given below.
ListenerRule2:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Properties:
ListenerArn: !Ref Listener
Priority: 3
Conditions:
- Field: path-pattern
Values: [ "/admin" ]
Actions:
- TargetGroupArn: !Ref TargetGroup
Type: forward
add a comment |
Above ListenerRule
matches files inside the admin folder (eg :- index.html) not the path /
. So, I added the missing ListenerRule
as given below.
ListenerRule2:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Properties:
ListenerArn: !Ref Listener
Priority: 3
Conditions:
- Field: path-pattern
Values: [ "/admin" ]
Actions:
- TargetGroupArn: !Ref TargetGroup
Type: forward
add a comment |
Above ListenerRule
matches files inside the admin folder (eg :- index.html) not the path /
. So, I added the missing ListenerRule
as given below.
ListenerRule2:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Properties:
ListenerArn: !Ref Listener
Priority: 3
Conditions:
- Field: path-pattern
Values: [ "/admin" ]
Actions:
- TargetGroupArn: !Ref TargetGroup
Type: forward
Above ListenerRule
matches files inside the admin folder (eg :- index.html) not the path /
. So, I added the missing ListenerRule
as given below.
ListenerRule2:
Type: AWS::ElasticLoadBalancingV2::ListenerRule
Properties:
ListenerArn: !Ref Listener
Priority: 3
Conditions:
- Field: path-pattern
Values: [ "/admin" ]
Actions:
- TargetGroupArn: !Ref TargetGroup
Type: forward
answered Jan 1 at 5:04


Ammar Ibnu AmeerdeenAmmar Ibnu Ameerdeen
4401316
4401316
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53992995%2faws-alb-routing-requested-url-not-found%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown