Blogger Information
Blog 63
fans 2
comment 0
visits 162932
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
宝塔面板非https站点使用https访问跳转其他网站内容的处理办法
书声的博客
Original
1832 people have browsed it

宝塔面板非https站点使用https访问跳转其他网站内容的处理办法

进入宝塔后台->网站->(指定未启用ssl的网站)设置->配置文件进行修改
其实说白了就是修改nginx或者Apache的配置文件而已
首先,加一个443端口,也就是https的端口监听
一般会默认添加80端口监听,我们直接在80端口监听下面添加一行监听443就行

  1. listen 80
  2. linsten 443

监听完端口后,进行判断,如果当前仅使用80端口,则同时键入如下规则:
若当前访问端口非80端口时,自动跳转至80端口

  1. if ($server_port != 80 ) {
  2. rewrite ^/(.*)$ http://$host/$1 permanent;
  3. }

随后保存,至此配置结束。
某些情况下,需要重启nginx或者apache才会生效,因此建议大家还是重启一下;

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post