Apace配置+http重定向到https

一、配置APache

  1. 打开apache安装目录下的 ssl.conf 配置以下内容
java 复制代码
<VirtualHost *:443>

# General setup for the virtual host, inherited from global configuration
#DocumentRoot "/var/www/html"
ServerName www.pwx.com
# 古籍检索系统 ,重定向到tomcat 中古籍检索系统项目
ProxyPass /record http://127.0.0.1:8080/record
ProxyPassReverse /record http://127.0.0.1:8080/record


ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
LogLevel warn

SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite DEFAULT:!EXP:!SSLv2:!DES:!IDEA:!SEED:+3DES
SSLCertificateFile /etc/httpd/conf/cert/www.pwxvr.com_public.crt
SSLCertificateKeyFile /etc/httpd/conf/cert/www.pwxvr.com.key
SSLCertificateChainFile /etc/httpd/conf/cert/www.pwxvr.com_chain.crt


</VirtualHost>                  

2.打开apache安装目录下的 httpd.conf 配置以下内容

java 复制代码
<VirtualHost *:8081>
  
    DocumentRoot   /var/www/html
   
	RewriteEngine on
    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R]

</VirtualHost>
相关推荐
德迅云安全—珍珍8 小时前
什么是udp攻击,为什么udp攻击难防御
网络·网络协议·udp
talenteddriver11 小时前
web: http请求(自用总结)
前端·网络协议·http
乾元12 小时前
AI 驱动的入侵检测与异常会话判别:从规则到行为分析前言:从“捕获敌人”到“守卫秩序”
运维·网络·人工智能·网络协议·安全
文弱书生65612 小时前
4-electronbot-USB协议前置知识
网络协议
LCG米13 小时前
车载以太网SOME/IP协议栈在TI TDA4VM平台上的实现与测试
网络·网络协议·tcp/ip
chalmers_1515 小时前
将单个 WebSocket 客户端封装为实例
服务器·websocket·网络协议
ZeroNews内网穿透16 小时前
EasyNode 结合 ZeroNews,实现远程管理服务器
运维·服务器·网络协议·安全·http
00后程序员张17 小时前
AppStoreInfo.plist 在苹果上架流程中的生成方式和作用
android·小程序·https·uni-app·iphone·webview
IT 行者18 小时前
Spring Boot 4 升级指南:告别RestTemplate,拥抱现代HTTP客户端
spring boot·后端·http
游戏开发爱好者818 小时前
对 iOS IPA 文件进行深度混淆的一种实现路径
android·ios·小程序·https·uni-app·iphone·webview