HTTPs到HTTP重定向

huangapple go评论53阅读模式
英文:

HTTPs to HTTP Redirection

问题

Currently, have one webserver(Domain - example1.com) and an appserver integrated through webplugin. Entire communication happens through HTTP. For ex. When a user hits URL http://example1.com/hello, it will load content available in /hello directory of appserver.

To make it secure, ALB with url(example2.com) has been set up and when user hits ALB url https://example2.com it will point to webserver(example1.com).

Need guidance/steps to take it forward, once request reached to webserver from ALB, it should automatically redirect to http://example1.com/hello, but URL in the browser should appear as https://example2.com/hello

Referred different online documents, but couldn't able to take it forward.

英文:

Currently, have one webserver(Domain - example1.com) and an appserver integrated through webplugin. Entire communication happens through HTTP. For ex. When a user hits URL http://example1.com/hello, it will load content available in /hello directory of appserver.

To make it secure, ALB with url(example2.com) has been set up and when user hits ALB url https://example2.com it will point to webserver(example1.com).

Need guidance/steps to take it forward, once request reached to webserver from ALB, it should automatically redirect to http://example1.com/hello, but URL in the browser should appear as https://example2.com/hello

Referred different online documents, but couldn't able to take it forward.

答案1

得分: 1

你无法。

如果你重定向,重定向到的URL将显示在浏览器的地址栏中。


你可以让https://example2.com仅提供指向http://example1.com<iframe>,但这会:

  • 使使用HTTPS的目的失效
  • 被浏览器标记为不安全或完全阻止

你可以将https://example2.com设置为反向代理,指向http://example1.com,但这样浏览器会与https://example2.com安全通信,然后example2.com不安全地将相同的数据转发至http://example1.com

如果https://example2.comhttp://example1.com在同一台计算机上(或者至少在同一安全网络中),这可能没问题,但否则会让用户产生错误的安全感,可能会导致一些非常糟糕的公关问题。

英文:

You can't.

If you redirect then the URL that you redirect to will be displayed in the browser's address bar.


You could make https://example2.com serve up nothing but an <iframe> that points to http://example1.com but this would:

  • Defeat the purpose of using HTTPS
  • Be alerted as insecure or blocked entirely by browsers

You could make https://example2.com a reverse proxy pointing to http://example1.com but then the browser would communicate securely with https://example2.com and then example2.com would forward the same data insecurely to http://example1.com.

This is probably OK if https://example2.com and http://example1.com are on the same computer (or at least in the same secure network) but is otherwise going to give users a false sense of security which could result in some very bad PR down the road.

答案2

得分: -2

你说你希望浏览器中的网址显示为https://example2.com/hello,我认为这是不可能的。

但是有一种方法可以尝试:

使用一个填充整个页面的