当前位置: 首页 > news >正文

淄博桓台网站建设方案青岛百度快速优化排名

淄博桓台网站建设方案,青岛百度快速优化排名,网站创建方法,如何确定网站建设 栏目https 访问我们的测试域名 https://www.xxx.com 站点,但是当我们直接在浏览器地址栏中直接输入 www.xxx.com 的时候却发现进入的是 http 协议的网站,这与我们的初衷不一致。由于浏览器默认访问域名使用的是80端口,而当我们使用SSL证书后&…

https 访问我们的测试域名 https://www.xxx.com 站点,但是当我们直接在浏览器地址栏中直接输入 www.xxx.com 的时候却发现进入的是 http 协议的网站,这与我们的初衷不一致。

由于浏览器默认访问域名使用的是80端口,而当我们使用SSL证书后,网站的端口就变成了443,所以当我们直接在浏览器中输入网址 www.xxx.com 的时候进入的是 80 端口的 HTTP 站点而不是 443 端口的 HTTPS 站点。

解决方法

这里提供两种 http 跳转到 https 的方法:

1. 使用nginx的 rewrite 将请求过来的 http URL直接重写成 https

server {

listen 80;

#填写绑定证书的域名

server_name www.xxx.com;

#强制将http的URL重写成https

rewrite ^(.*) https://$server_name$1 permanent;

}

2. 使用301重定向的方式将 http 的请求重定向到 https 上

server {

listen 80;

#填写绑定证书的域名

server_name www.xxx.com;

#把http的域名请求转成https

return 301 https://$host$request_uri;

}

3.完整的代码

# https配置

server {

listen 443 ssl;

server_name www.xxx.com xxx.com;

#ssl on; #开启ssl支持

ssl_certificate /data/ssl/www.xxx.com.pem; #指定服务器证书路径

ssl_certificate_key /data/ssl/www.xingguangshe.com.key; #指定私钥证书路径

ssl_session_timeout 5m;

#ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

#ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;

#ssl_prefer_server_ciphers on;

root /myweb/new/xxx.com;

location / {

index index.php index.html index.htm;

if (!-e $request_filename) {

rewrite ^/(.*)$ /index.php/$1 last;

break;

}

}

location ~ \.php/?.*$ {

fastcgi_pass 127.0.0.1:9000;

fastcgi_split_path_info ^(.+\.(?:php|phar))(/.*)$;

fastcgi_intercept_errors on;

fastcgi_index index.php;

include fastcgi_params;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

fastcgi_param PATH_INFO $fastcgi_path_info;

#fastcgi_pass php-fpm; #uquq use this

}

location ~ /\.ht {

deny all;

}

}

#http配置

server {

listen 80;

#listen somename:8080;

server_name www.xxx.com xxx.com;

client_max_body_size 80m;

#error_page 404 /data/ymg280/404.html;

#error_page 500 502 503 504 /errors/default/50x.html;

rewrite ^(.*) https://$server_name$1 permanent;

if ($host != 'ww.xxx.com'){

#rewrite ^/(.*)$ http://www.xxx.com/$1 permanent;

}

root /myweb/new/xxx.com;

location / {

index index.php index.html index.htm;

if (!-e $request_filename) {

rewrite ^/(.*)$ /index.php/$1 last;

break;

}

}

#pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

location ~ \.php/?.*$ {

fastcgi_pass 127.0.0.1:9000;

fastcgi_split_path_info ^(.+\.(?:php|phar))(/.*)$;

fastcgi_intercept_errors on;

fastcgi_index index.php;

include fastcgi_params;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

fastcgi_param PATH_INFO $fastcgi_path_info;

#fastcgi_pass php-fpm;

}

#deny access to .htaccess files, if Apache's document root

location ~ /\.ht {

deny all;

}

}

http://www.dinnco.com/news/20557.html

相关文章:

  • 做那个网站比较好最新域名ip地址
  • 南昌政府网站建设百度口碑
  • mysql 注册网站seo发帖论坛
  • 网站如何生成app河南网站建设报价
  • 政府机构网站建设哪里有软件培训班
  • 新网站怎么做seo商业公司的域名
  • 视频投票网站怎么做seo模拟点击有用吗
  • 小程序推广费用一个月需要多少钱关键词优化是什么意思?
  • 做私彩网站经典营销案例100例
  • 网站开发的项目开发成都正规搜索引擎优化
  • 襄阳市城乡建设委员会网站百度推广一级代理商名单
  • 仿做赌博网站宁波seo推广哪家好
  • apache添加网站如何seo搜索引擎优化
  • 网站开发全流程管理课程培训
  • 网站做抽奖活动人工智能培训心得
  • 网站建设后台功能模块网页搜索快捷键是什么
  • 厦门网站建设高级课程企业培训课程表
  • 青岛建网站的公司网络营销ppt怎么做
  • 企业站模板大全网络营销常用的工具和方法
  • 网站怎么做才是对搜索引擎友好最新新闻热点话题
  • 签证网站建设搜索引擎入口yandex
  • 在线crm有哪些优势seo诊断服务
  • 南宁网站建设公司seo诊断优化方案
  • 朝阳网站关键词优化百度知道下载
  • 河北省住房和城乡建设部网站网址收录查询
  • flash制作网站的好处关键词权重
  • 淘宝刷单网站制作网站搜索排名
  • 电子商务网站建设怎么做百度下载安装 官方
  • 浙江常规网站建设网站网址大全
  • 门户网站cms坚持