使用SSL for Wordpress应用程序的AWS中的GoDaddy域 [英] GoDaddy domain in AWS with SSL for Wordpress application Issue

查看:92
本文介绍了使用SSL for Wordpress应用程序的AWS中的GoDaddy域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我正在使用Wordpress应用程序,并且正在使用AWS托管.我的域在GoDaddy.com中,并且已经在弹性beantalk中部署了该应用程序.我已经创建了负载均衡器,并且还需要通过HTTPS运行该应用程序. 我已经完成研究,我认为我找到了正确的方法,但是它不适用于HTTPS.当我在端口80上浏览HTTP时,它运行良好.现在我很无助.

到目前为止,这是我所做的:
1) 我在AWS Route 53上为名为"example.com"的域创建了一个托管区域.创建了两个记录,即NS和SOA.
2) 然后,在GoDaddy中,我从AWS添加了NS记录作为自定义名称服务器.
3)之后,我在AWS托管区域中为域创建了一条记录,将ALIAS设置为针对Elastic Beanstalk环境的负载均衡器.
4)然后,我从wp_options表中的wordpress应用程序数据库中更改了SITE URL.

完成此操作后,我的应用程序已在HTTP中运行.但是正如我想将其更改为HTTPS一样.所以,

Currently, I am working on a Wordpress application and I am using AWS hosting. My domain is in GoDaddy.com and I have deployed the application in elastic beanstalk. I have created load balancer and also I need to run the application through HTTPS. I have done my research and I think I found the right way, but it's not working for HTTPS. when I browse on HTTP on port 80, it runs well. Now I am helpless.

Here's what I have done so far:
1)   I created a hosted zone on AWS Route 53 for the domain named "example.com". There are two records are created, NS and SOA.
2)   Then, in GoDaddy, I added NS records from AWS as Custom Nameservers.
3)   After that, I created A record for the domain in the AWS hosted zone, set ALIAS targeted to the Load Balancer of the Elastic Beanstalk environment.
4)   Then, I changed the SITE URL from the wp_options table the wordpress application database.

After doing up to this, my application was running in HTTP. But as I want to change it to HTTPS. So,

1) 我从AWS Certificate Manager请求了证书,并在托管区域中创建了CNAME(由ACM在请求证书后提供)记录.
2) 颁发证书后,我从EC2 >> Load Balancer >> Listener编辑了侦听器,并将协议从HTTP更改为HTTPS,并且还允许安全组上的端口.
3)此外,我还更改了WordPress数据库中的SITE URL,并将其从" http://example.com 更改为" https://example.com ",但它不起作用.
4)所以我去了Elastic Beanstalk >> Configuration >> Load Balancer并添加了侦听器.保存并重新启动环境后,该站点仍未在HTTPS上运行[HTTP 408错误,显示].但是,如果我将SITE URL更改为" http://example.com ",则可以正常使用

1)   I requested a certificate from AWS Certificate Manager and created CNAME (provided by ACM after requesting certificate) record in the hosted zone.
2)   After the certificate is issued, I edited the listener from EC2 >> Load Balancer >> Listener and changed the protocol from HTTP to HTTPS and also allowed port on Security groups.
3)   Also, I changed, the SITE URL from WordPress database and changed it from "http://example.com" to "https://example.com" but it was not working.
4)   So I went to Elastic Beanstalk >> Configuration >> Load Balancer and added listener. After the environment is saved and restarted, still, the site was not running on HTTPS [ HTTP 408 ERROR IS SHOWN ]. But if I change SITE URL to "http://example.com", it works

我找到了一个解决方案,该解决方案说使用RedirectURL并将其设置为服务器配置,但我不想这样做.

I have found a solution, which says to use RedirectURL and set it to server config but I don't want to do that.

我还找到了解决方案建议导出区域文件并将其导入到AWS托管区域.但是,每当我单击导出区域文件(Unix)"时,下载的文件就会显示为空.我为其他帐户尝试过此操作,但仍然存在此问题.所以我没有那样做.

I also found this solution which suggest to Export Zone File and import it to AWS hosted zone. But whenever I click Export Zone File(Unix), the file downloaded is shown empty. I tried this for other accounts, still, this problem exists. So I did not do that.

很抱歉,但我确实需要此帮助.

Sorry for the long story, but I really need this help.

推荐答案

我已经解决了这个问题.

I have solved the issue.

在我的负载均衡器端口配置中,我之前设置了负载均衡器端口443和实例443.在这里,我需要做的是在端口443上调用负载均衡器,然后在端口80上进行后端调用,并在WordPress上启用https

In my load balancer port configuration, I previously set load Balancer port 443 and instance 443. here what I need to do is to call the load balancer on port 443 and backend make the backend call on port 80 and enable https on WordPress.

因此,我保留了负载均衡器端口443,并将实例端口更改为80.此后,在浏览器上显示了too many redirects错误.因此,我需要做的是在wp-config上添加$_SERVER['HTTPS'] = 'on'.然后,一切运行顺利.

So I kept load balancer port 443 and changed the instance port to 80. After that, on the browser, there was too many redirects error shown. So then what I needed to do is that add $_SERVER['HTTPS'] = 'on' on wp-config. And then everything was running smoothly.





我希望这会有所帮助

这篇关于使用SSL for Wordpress应用程序的AWS中的GoDaddy域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆