AWS ALB routing - Requested url not found












0















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










share|improve this question



























    0















    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










    share|improve this question

























      0












      0








      0








      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










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 1 at 4:24









      Ammar Ibnu AmeerdeenAmmar Ibnu Ameerdeen

      4401316




      4401316
























          1 Answer
          1






          active

          oldest

          votes


















          1














          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





          share|improve this answer























            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
            });


            }
            });














            draft saved

            draft discarded


















            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









            1














            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





            share|improve this answer




























              1














              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





              share|improve this answer


























                1












                1








                1







                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





                share|improve this answer













                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






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 1 at 5:04









                Ammar Ibnu AmeerdeenAmmar Ibnu Ameerdeen

                4401316




                4401316
































                    draft saved

                    draft discarded




















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    MongoDB - Not Authorized To Execute Command

                    in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

                    Npm cannot find a required file even through it is in the searched directory