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>
相关推荐
Inhand陈工7 小时前
游轮WiFi覆盖方案复盘:6台5G CPE + AP实现全船高速上网
人工智能·物联网·网络协议·网络安全·信息与通信·iot
Flash.kkl8 小时前
网络层协议IP、数据链路层、NAT详解
服务器·网络·网络协议·tcp/ip
缪懿10 小时前
应用层中的TCP协议原理
网络·网络协议·tcp/ip
梦奇不是胖猫10 小时前
[ 计算机网络 | 第三章 ] 数据链路层 02 PPP
网络·网络协议·计算机网络
Ether IC Verifier11 小时前
TCP 重传机制详解
服务器·网络·网络协议·tcp/ip·php
北京耐用通信11 小时前
耐达讯自动化:专业解决MODBUS TCP转PROFIBUS协议转换难题
人工智能·物联网·网络协议·自动化·信息与通信
yqcoder12 小时前
拆解互联网:通俗易懂的网络分层模型
前端·网络·网络协议
薛定谔的猫喵喵16 小时前
【从 HTTP 到 HTTPS】Flask 多项目迁移到 Nginx 子路径完整实战
python·nginx·http·https·flask·ssl
zhz521416 小时前
Spring Boot + 腾讯 Kona 实现 TLCP 8443 国密 HTTPS 排障实录(奇安信浏览器已通)
spring boot·后端·https·国密·gmssl·kona
曾阿伦17 小时前
requests HTTP 库解析
网络·网络协议·http