Questions tagged with Application Load Balancer

Content language: English

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

0
answers
0
votes
4
views
asked 5 hours ago

ASP.NET Core Application not Running in AWS Linux EC2 instance instead showing Apache Test Page

I have have an AWS CodePipeline process that gets the CodeCommit repository builds the application and publish the application to the Linux EC2 instances. The entire process executes successfully and I can see the final asp.net core application gets published to the /var/www/html/ folder. But when I get loads the URL of the load balancer (EC2 instances are behind a load balancer), I see the Apache test page, not the asp.net core application. The asp.net core application I created is just the default asp.net core web application that gets created by default. Below is the buildspec.yaml file. (This publishes a self-contained application) ``` version: 0.2 env: variables: DOTNET_CORE_RUNTIME: 6.0 phases: install: on-failure: ABORT runtime-versions: dotnet: ${DOTNET_CORE_RUNTIME} commands: - echo install stage - started `date` pre_build: commands: - echo pre build stage - stared `date` - echo restore dependencies started `date` - dotnet restore ./WebApplication1/WebApplication1.csproj build: commands: - echo build stage - started `date` - dotnet publish --configuration Release --runtime linux-x64 ./WebApplication1/WebApplication1.csproj --self-contained - cp ./WebApplication1/appspec.yml ./WebApplication1/bin/Release/net6.0/linux-x64/publish/ artifacts: files: - '**/*' - appspec.yml name: artifact-test-cham discard-paths: no base-directory: ./WebApplication1/bin/Release/net6.0/linux-x64/publish/ ``` And below is the appspec.yaml file that copies the content from the S3 artifact location to the /var/www/html/ folder ``` version: 0.0 os: linux files: - source: / destination: /var/www/html/ ``` Following image shows that the web application gets successfully published to the /var/www/html folder in the Linux EC2 instance with other asp.net core framework dependent files. But even though all the web application files along with other framework files are available, as I said, when I navigate through the load balancer, I can see the Apache test page only. ![Enter image description here](/media/postImages/original/IMrj2EksFtRkigsg3lcuTJBA) Below is the "Configure" method in the application. ``` // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { app.UseStatusCodePages(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapRazorPages(); }); } ``` What am I doing wrong in here? Do I have to do something from the application side? Please let me know. UPDATE: Below is the instance UserData used to in each EC2 instance. ``` #!/bin/bash -xe sudo su sudo yum -y update yum install -y ruby yum install -y aws-cli sudo amazon-linux-extras install -y php7.2 sudo yum install httpd -y sudo systemctl start httpd sudo systemctl enable httpd sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm cd /home/ec2-user # downloading & installing CodeDeploy Agent as per https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-simple-s3.html#S3-create-instances aws s3 cp s3://aws-codedeploy-${AWS::Region}/latest/install . --region ${AWS::Region} chmod +x ./install ./install auto ```
2
answers
0
votes
68
views
champer
asked 18 days ago

App Mesh - ECS Tasks Failing Health Check After Adding Envoy Proxy to Task Definition

Hey everyone, I currently have a application that consists of three services in a ECS Fargate cluster. I also have a ALB which routes external traffic to these services as well. These three services talk also talk internally to each other which is what I would like to enclose in a App Mesh. I set up AWS Cloud Map for my three services and created the corresponding mesh/virtual services/virtual nodes. The App mesh leverages AWS Cloud Map for service discovery. All of my tasks were running healthy and AWS Cloud Map picked up all the service instances correctly. My issue begins when I enable app mesh integration in the ECS task definitions/adding the envoy proxy container to the task definition. When I do this my ECS tasks begin to create and then automatically delete themselves due to the ALB health checks failing against my tasks. Basically when I just have a single container in my task which holds my service, the ALB health check passes. When I add the envoy proxy sidecar container to my task, the envoy container returns healthy but my service container returns unhealthy until the task deletes itself. Specifics -------------------------------- ALB forwards requests to target groups via HTTPS protocol on port 7001. ALB health checks use HTTPS on port 7001. It checks every 30 seconds and will timeout after 5 seconds. It will turn unhealthy after 3 consecutive failures. Task definition for example service has two containers. One for the service itself and the other as the envoy proxy sidecar. Container holding the service itself has Host and Container port mappings of port 7001. Containing holding the service itself has a dependency that the envoy proxy container is healthy before creating container. ECS task definition has the following proxy configuration values: **Proxy container name:** envoy **Type:** APPMESH **Ignored UID:** 1337 **App ports:** 7001 **Proxy ingress port:** 15000 **Proxy egress port:** 15001 **Egress ignored IPs:** 169.254.170.2,169.254.169.254 I've spent the past two days trying to figure out why my service containers return unhealthy after adding the envoy proxy container and I've exhausted all my options, I really need some guidance here and would greatly appreciate it! :)
0
answers
0
votes
21
views
asked 18 days ago

HTTP API PROXY INTEGRATION_NETWORK_FAILURE Error

Hi, Here is my setup: my.domain.com -> API GW Custom Domain -> HTTPAPI -> Route (/api/{+proxy}) -> VPCLink -> ALB -> HTTPS Listener -> TargetGroup (Type: Instance) -> ECS Fargate Service HTTPAPI integration has the following parameter mapping: path -> overwrite -> /$request.path.proxy (I want to get rid of "api" part in the url) when I make below request I got 503 errors time to time: https://my.domain.com/api/otherPath I have enabled access logs on HTTPAPI but they show very limited information. ALB logs are sent to S3 bucket so it is almost impossible to track request. Why do I get 503 errors ? Access log from HTTP API: ``` { "requestId": "req_id=", "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15", "sourceIp": "**.**.**.**", "requestTime": "09/Nov/2022:18:07:24 +0000", "requestTimeEpoch": "1668017244", "httpMethod": "GET", "path": "/otherPath", "status": "503", "protocol": "HTTP/1.1", "responseLength": "33", "domainName": "my.domain.com", "basePathMatched": "(none)", "error_Message": "Service Unavailable", "error_responseType": "INTEGRATION_NETWORK_FAILURE", "integrationErrorMessage": "-", "integration_Error": "-", "integrationStatus": "200", "integration_Status": "-", "integration_IntegrationStatus": "200", "integrationLatency": "9002" } ``` Please help, Thanks
0
answers
0
votes
21
views
asked a month ago