WordPress Deployed in Elastic Beanstalk has an error "This site can't be reached"

0

The health of the environment is "Ok" but when I try to open the domain in the browser, it just kept on loading and eventually an error "This site can't be reached" showed up. The ALB allows traffic in port 443 and EC2 allows traffic on port 80. I even tried configuring the Internet and Sharing of my Windows 10 but it didn't help. Please help guys. Thank you! Enter image description here

profile picture
Vin
질문됨 9달 전341회 조회
1개 답변
1
수락된 답변

Hello.
Have you set up your domain in ALB?
Perhaps you are accessing the Elastic Beanstalk domain.
Accessing the following domain will bring up the WordPress configuration page.
However, an error occurs because the CSS is loaded as http.
Try setting up a redirect from http to https in ALB.
Also, make sure that port 80 is allowed in the ALB security group.

https://pinoyagri.com/wordpress/wp-admin/setup-config.php

Please refer to the following document for ALB redirect settings.
https://repost.aws/knowledge-center/elb-redirect-http-to-https-using-alb

Mixed content may be fixed by setting the following in wp-config.php.

if($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
  $_SERVER['HTTPS'] = 'on';
  $_ENV['HTTPS'] = 'on';
}
profile picture
전문가
답변함 9달 전
profile picture
전문가
검토됨 2달 전
  • Thank you again Riku! I already set up the pinoyagri.com in Route 53. I enabled alias and the "Route traffic to" is the ALB. I can see that http in port 80 is allowed in the ALB because it is present in the inbound rule of the security group. When I finished setting up redirect from http to https, the error "This site can't be reached" is no longer the issue but the 403 Forbidden. As far as I remember you told be back then that it was an issue in configuring my WordPress. I tried understanding the steps on this link: https://github.com/aws-samples/eb-php-wordpress before but it looks like it is no longer updated to today's setup. I'll find other relevant resources and please do let me know for any links or steps that might help related to this issue.

  • Hi Riku! This time around I was able to use the code "if($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') { $_SERVER['HTTPS'] = 'on'; $_ENV['HTTPS'] = 'on'; }" to address the mixed content. This finally was enabled me to run WordPress successfully. Thank you so much!

  • Since I'm using Elastic Beanstalk, do you think it would be better to deploy again the WordPress and add ".ebextensions" folder and include that PHP code?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠