英文:
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.com
和http://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,我认为这是不可能的。
但是有一种方法可以尝试:
使用一个填充整个页面的
也许这可以帮助你~
英文:
you said you want URL in the browser appears as https://example2.com/hello, I think this is not possible.
But there is one way you can try:
using a <iframe> that fill the entire page, and write "http://example1.com/hello" to the src of the <iframe>.
Note that https may not work properly...
May this can help you~
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论