Getting 502 proxy error after deploying app to AWS - amazon-web-services

I deployed an Application to AWS elastic beanstalk. When I try to open the application, I am getting 502 proxy error Saying following message.
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /.
Reason: Error reading from remote server
Apache/2.2.31 (Amazon) Server at mehe.us-west-2.elasticbeanstalk.com
Port 80
Strange part is when I run the application from localhost(Still connected to amazon database) the application is working fine, but after deloying it is not working. Here's the link to application
Any ideas how to get rid off it.

The timeout value for HTTPD is lower than the timeout value set for ELB. Change the timeout value in /etc/httpd/conf/httpd.conf
The keep the value between reboots you'll need to either create a custom AMI or use .ebextensions feature.

Related

GCP Cloud Run 503 Error: Service unavailable for asp.net website

I'm trying to deploy the asp.net website in cloud run but am stuck with this error - "The request failed because either the HTTP response was malformed or connection to the instance had an error. (Service Unavailable 503)"
This is https & http docker files. one of many such services.
for http-5176 -- http URL of cloud run is not registered in the azureAD app - I'm getting can't redirect error when I access the cloud run URL which is expected that is fine.
but for https-7176 -- https URL of cloud run which is registered in azureAD is immediately throwing Service Unavailable 503, not sure whether it is redirected to auth or not.
Thing is, when I try these two container images locally in docker desktop it is working fine - https://localhost:PORT redirects to authentication page and website is loaded as expected with some other api call errors. But when I deploy the same in cloud run -- Service Unavailable 503
Cloud run config
2 CPU limit
512MB Memory limit
1 Concurrency
500sec request timeout
Tried some troubleshooting
Concurrency is at low
No VPC access connector is used for now.
No errors on memory exceeding in logs
Expecting - to authenticate and load webpage knowing that there are few api error in that to work on later.
Do you have any idea what could be causing this? And how to reslove this?
Thanks for your answers in advance.
As cloud run redirects HTTP requests to HTTPS. after a long trial and error, with my application team. In the code, they added a redirection from HTTP to HTTPS and I'm running my cloud-run service in the HTTP port. Now it is working fine.

Connecting to GO websocket server running on AWS Beanstalk

I have a websocket server built with go running on AWS beanstalk. I'm running a load balancer with a SSL cert. I'm having issues connecting to it via the browser. If I try to connect to it through another go program running on my terminal everything works fine. I've updated my environment to accept TCP instead of HTTP connections on port 80.
When I try to connect from the webapp though I get this error.
WebSocket connection to 'wss://root.com/users/fcbd7f8d-2ef6-4fe2-b46c-22db9b107214/sockets/client'
failed: Error during WebSocket handshake: Unexpected response code: 400
When I check the AWS logs I find this error.
the client is not using the websocket protocol:
'websocket' token not found in 'Upgrade' header
UPDATE
if I run the webapp on my localhost and change the connection string from wss:// to ws:// it works. If I try the same url in the live webapp I get an ssl error.
Mixed Content: The page at 'https://root.com/captions' was loaded over HTTPS,
but attempted to connect to the insecure WebSocket endpoint
'ws://root.com/users/fcbd7f8d-2ef6-4fe2-b46c-22db9b107214/sockets/client'.
This request has been blocked; this endpoint must be available over WSS.

aws beanstalk single instance 502 proxy error

I'm trying to configure an aws beanstalk single instance. I've successfully created the instance, but when I navigate to the Environment URL, I get the following error.
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /.
Reason: Error reading from remote server
What could be causing this and what do I need to do to fix it.
I'm deploying a java web app using tomcat.

Unable to open redis 6379 for inbound on AWS EC2

I have two servers on EC2. One hosting my php application and other hosting my redis server. I am managing my php session and data on redis server. So on my php server I gave the ip:port as session save path and got the error FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught exception 'RedisException' with message 'Connection closed'
So I search on the web and came to know that I need to open port 6379 on my redis instance for inbound traffic. I opened it by setting a custom TCP setting in AWS security group but still the port is coming closed to outside world. But I am able to listen to the port on redis server itself. Am i Missing anything in the process? Do I need to make any other change somewhere. Please guide me on this. I am very much new to AWS management
On Instance 1: I am using php-fpm, nginx and phpredis
On Instance 2: Using Redis

aws ec2 caching (always returns 304)

I have created a fresh EC2 instance, installed Apache2 and pointed my domain (hamidlab.com) to ip of this instance. When I browse my domain it shows default apache/ubuntu page, then I stopped apache2 service and try to access (hamidlab.com) it still shows apache/ubuntu default page, now when I try to access 1.hamidlab.com it says
Could Not Connect
Description: Could not connect to the requested server host.
and returns Header Status Code: 502 Connection refused
I tried with nginx server, still same caching issue.
Do AWS have any caching set ?
I am not using any other service than ec2.