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>
相关推荐
周杰伦fans7 小时前
.NET Core WebAPI 中 HTTP 请求方法详解:从新手到精通
网络协议·http·.netcore
toooooop87 小时前
Nginx 反向代理 HTTPS CDN 配置检查清单(避坑版)
运维·nginx·https·cdn
尽兴-10 小时前
[特殊字符] 微前端部署实战:Nginx 配置 HTTPS 与 CORS 跨域解决方案(示例版)
前端·nginx·https·跨域·cors·chrom
@大嘴巴子11 小时前
零基础学习计算机网络编程----理解http协议
学习·计算机网络·http
利刃大大12 小时前
【高并发服务器:HTTP应用】十五、HttpRequest请求模块 && HttpResponse响应模块设计
服务器·c++·http·项目
labview_自动化13 小时前
RPC和Restful
网络协议·rpc·restful
爱吃汽的小橘14 小时前
MIPI DSI和MIPI Tx IP 的建立
网络·网络协议·tcp/ip
自由生长202415 小时前
Nginx的代理原理和使用配置
网络协议·nginx
蜗牛^^O^15 小时前
OSI七层模型与TCP/IP 四层模型
网络·网络协议·tcp/ip
z10_1417 小时前
海外住宅ip怎么区分干净程度以及怎么选择海外住宅ip
服务器·网络·网络协议·tcp/ip