简体   繁体   English

AWS 应用程序负载均衡器背后的 wordpress 网站

[英]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.

相关问题 AWS负载平衡器背后的Wordpress多站点 - Wordpress multisite behind an AWS load balancer 通过负载均衡器背后的AWS Certificate Manager使用SSL设置Wordpress网站 - Setting up a wordpress website with SSL from AWS certificate Manager behind Load Balancer AWS EC2上的wordpress(2个实例和一个负载均衡器) - wordpress on AWS EC2 ( 2 instances and a load balancer) 带有应用程序负载平衡器的 Wordpress 导致 301 重定向 - Wordpress with application load balancer resulting in 301 redirect 使用ProxyPass在负载均衡器后面将Wordpress http更改为https - Changing Wordpress http to https behind a Load Balancer with ProxyPass 如何在 Amazon 负载均衡器后面修复 WordPress HTTPS 问题? - How to fix WordPress HTTPS issues when behind an Amazon Load Balancer? 负载均衡器背后的Wordpress get_template_directory_uri() - Wordpress get_template_directory_uri() behind load balancer 在负载均衡器后面运行时如何登录wordpress页面? - How to login wordpress page when running behind a load balancer? 带有Wordpress的CodeIgniter,带有http的https,带有Load Balancer的AWS,Wordpress永久链接不起作用 - CodeIgniter with Wordpress, https with http, on AWS with Load Balancer, Wordpress permalinks not working AWS负载均衡器将Wordpress URL强制到特定实例 - AWS Load balancer force Wordpress URL to specific instance
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM