简体   繁体   English

禁用Heroku App的SSL(Django)

[英]Disable SSL for Heroku App (django)

We've decided not to use SSL anymore and unfortunately our server guy has quit and now I need to fix this. 我们已决定不再使用SSL,很遗憾,我们的服务器人员已退出,现在我需要解决此问题。 I've revoked the certs from Comodo, removed the SSL app from Heroku but that was apparently not enough and now we have serious problems with our site. 我已经撤销了Comodo的证书,从Heroku中删除了SSL应用程序,但这显然还不够,现在我们的网站存在严重问题。

When visiting inteokej.nu one gets redirected to the app, but automatically http turns to https and instead of showing the domain (inteokej.nu) the app link is shown https://inteokej.herokuapp.com (I want inteokej.nu to be shown, not the actual app link). 当访问inteokej.nu时,一个重定向到该应用程序,但是自动将http转换为https,而不是显示域(inteokej.nu),该应用程序链接显示为https://inteokej.herokuapp.com (我希望将inteokej.nu链接到)显示,而不是实际的应用链接)。

That is a problem but not the biggest problem, which is that it's not possible to use the site anymore (eg login, the static pages works though). 这是一个问题,但不是最大的问题,那就是无法再使用该站点(例如,登录,静态页面有效)。 When I try to login I first get a https security error and when I proceed I get to the following page: https://www.inteokej.nu/cgi-sys/defaultwebpage.cgi ("Sorry! If you are the owner of this website, please contact your hosting provider: webmaster@inteokej.nu"). 当我尝试登录时,我首先收到一个https安全错误,当我继续时,进入以下页面: https : //www.inteokej.nu/cgi-sys/defaultwebpage.cgi (“抱歉!如果您是该网站,请与您的托管服务提供商联系:webmaster@inteokej.nu“)。

I've now learned the hard way that SSL is a complex thing but I really need to get this site up again as soon as possible. 现在,我已经了解到SSL是一件复杂的事情,但是我确实需要尽快重新建立该站点。 So, where should I start and how could I proceed from this point? 那么,我应该从哪里开始?从现在开始我该如何进行? I guess there's some back end coding that should be done in the django code as well? 我想在Django代码中也应该做一些后端编码?

Thanks a lot in advance! 在此先多谢!

Your issue doesn't seem to be with SSL but DNS or at least however your server guy set things up. 您的问题似乎与SSL无关,但与DNS无关,或者至少由服务器人员负责。

The error page you're seeing isn't a Heroku error, inteokej.nu isn't being hosted on Heroku but on a server run by your DNS provider svenskadomaner.se . 您看到的错误页面不是Heroku错误,不是inteokej.nu托管在Heroku上,而是托管在您的DNS提供商svenskadomaner.se运行的服务器上。

If you use the Firefox Live HTTP Headers plugin you can follow the request/response cycle and you'll see that there is a 301 redirect from www.inteokej.nu to inteokej.herokuapp.com (probably an .htaccess redirect). 如果您使用Firefox Live HTTP标头插件,则可以遵循请求/响应周期,您会看到从www.inteokej.nu到inteokej.herokuapp.com的301重定向(可能是.htaccess重定向)。

Check the DNS records for your domain (like here http://viewdns.info/dnsrecord/?domain=inteokej.nu ) you'll see that there is no CNAME record to Heroku, only an A Record to 46.22.116.5 which is an IP Address owned by svenskadomaner.se. 检查您域的DNS记录(例如http://viewdns.info/dnsrecord/?domain=inteokej.nu ),您会看到Heroku没有CNAME记录,只有46.22.116.5的A记录是svenskadomaner.se拥有的IP地址。

So the thing to do is to set up the custom domain as recommended on Heroku's site: 因此,要做的是按照Heroku网站上的建议设置自定义域:

https://devcenter.heroku.com/articles/custom-domains https://devcenter.heroku.com/articles/custom-domains

and set the CNAME to Heroku's recommendation. 并将CNAME设置为Heroku的推荐。

One reason your server guy might have set things up like they did is that Heroku doesn't easily allow "naked domains", so people often do .htaccess redirects from example.com to www.example (which does work easily with CNAMEs). 您的服务器人员可能会像以前那样进行设置的原因之一是Heroku不允许轻易地使用“裸域”,因此人们经常将.htaccess重定向从example.com重定向到www.example(使用CNAME可以轻松地进行重定向)。

Good luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM