当前位置: 首页 > 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.zhongyajixie.com/news/29633.html

相关文章:

  • 网站建设设计制作长沙seo智优营家
  • 陈村网站建设百度客户端下载安装
  • 建设银行辽宁招聘网站sem竞价推广代运营
  • 郑州动力无限网站建设app营销十大成功案例
  • 做网站的软件电子新浪体育nba
  • 自建网站经营者例子google关键词查询工具
  • 淮安网站制作脱发严重是什么原因引起的
  • 怎么查公司地址百度竞价关键词优化
  • 创建网站收费接广告推广
  • 做网站就上微赞网网络营销渠道类型有哪些
  • 山东免费网站建设门户网站软文
  • 怎么做PayPal网站收款怎么做百度推广运营
  • 永康做网站周口seo公司
  • 电子商务公司网站怎么建系统优化软件哪个最好的
  • 网站推广广告公司博客网站登录入口
  • 发布php做的网站seo建站技术
  • 用代码怎么做网站seo系统培训班
  • 网上如何建网站怎么自己做一个小程序
  • 深圳做网站的好公司关键词搜索名词解释
  • 网站建设需要哪些成本信息流推广的竞价机制是
  • 做直播网站需要学什么软件有哪些独立站搭建要多少钱
  • 域名未做运行网站解析大数据查询
  • 竞价开户seo排名外包
  • 宣传图制作网站营销推广有哪些公司
  • 出名的网站有哪些什么是关键词广告
  • 完全自建网站360优化大师下载
  • 做蔬菜配送有什么网站可下载了解如何推广微信公众号
  • 做网站年薪百万网站seo方案撰写
  • 网站建设 英语翻译网站推广优化排名公司
  • 网站导航栏按钮网站推广app