Http requests redirected to https

时间秒杀一切 提交于 2021-01-29 05:25:20

问题


Goal: I want all requests made to http://mydomain to be redirected to https://mydomain.

Today I have an Apache web server which handles all incoming requests made to http://mydomain and redirects them to http://localhost:8080 (JBoss application server). I'm using proxypass for my virtual host in the Apache configuration.

What do I need to do to achieve my goal?


回答1:


The Apache Foundation recommended approach is to have a dummy VirtualHost on port 80 with:

<VirtualHost *:80>
    ServerName www.example.com
    Redirect "/" "https://www.example.com/"
</VirtualHost>

You can configure your existing VirtualHost for SSL.



来源:https://stackoverflow.com/questions/51818050/http-requests-redirected-to-https

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!