[英]wordpress website behind AWS Application load balancer
I created Application Load Balancer in AWS and installed word press website on ec2-instance.我在 AWS 中创建了 Application Load Balancer 并在 ec2-instance 上安装了 wordpress 网站。 I can access website fine if I access using the public ip address of ec2-instance.如果我使用 ec2-instance 的公共 IP 地址访问,我可以正常访问网站。 However, I cannot access the pages whenever I try to access using DNS Name of Application Load Balancer.但是,每当我尝试使用 Application Load Balancer 的 DNS 名称访问时,我都无法访问这些页面。 The error code returned by chrome is 301
. chrome 返回的错误代码是301
。
Security Group of instance allows all traffic from load balancer at port 80.实例的安全组允许来自负载均衡器在端口 80 的所有流量。
There is nothing in the access logs or error logs.访问日志或错误日志中没有任何内容。 I have no experience dealing with wordpress.我没有处理 wordpress 的经验。 Please let me know if I can provide any further information to find issue.如果我可以提供任何进一步的信息来查找问题,请告诉我。
Edit: If I place the same instance behind Classic Load Balancer
, instead of Application Load Balancer
, then it seems to work fine.编辑:如果我将同一个实例放在Classic Load Balancer
后面,而不是Application Load Balancer
,那么它似乎工作正常。
301
is a redirect, not an error code. 301
是重定向,而不是错误代码。 You probably need to configure your custom domain to point to the load balancer, then configure Wordpress to be aware of the domain name so it won't try to redirect.您可能需要将自定义域配置为指向负载均衡器,然后将 Wordpress 配置为知道域名,这样它就不会尝试重定向。
I guess you installed WordPress directly by accessing the ec2 instance?我猜你是通过访问 ec2 实例直接安装 WordPress 的?
I can remember a similar problem with WordPress making redirections (301) when it has been installed via a wrong domain.我记得 WordPress 在通过错误的域安装时进行重定向 (301) 的类似问题。 If it is an option, reinstalling WordPress directly through the Load Balancer should fix this problem.如果可以选择,直接通过负载均衡器重新安装 WordPress 应该可以解决此问题。
@Zohaib - i am having the exact same issue. @Zohaib - 我遇到了完全相同的问题。 I installed wordpress directly on EC2 instance.我直接在 EC2 实例上安装了 wordpress。 Although I have changed siteurl and home for wordpress to point to my application load balancer, the wp-admin link still takes me to the EC2 instance.尽管我已将 wordpress 的 siteurl 和 home 更改为指向我的应用程序负载均衡器,但 wp-admin 链接仍会将我带到 EC2 实例。 I know it has been a while, but I can use your suggestion我知道已经有一段时间了,但我可以使用你的建议
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.