目的:访问http://sdk.open.test.com/时强制自动跳转到https://sdk.open.test.com/

修改nginx站点配置文件sdk.open.test.com.conf

server
{
  listen 80;
  server_name sdk.open.test.com;
  return 301 https://$server_name$request_uri;

}

server
{
  listen 443 ssl;
  server_name sdk.open.test.com;
  index index.html index.htm index.php;
  root /data/www/web/;
  charset utf-8;

  location ~.*\.(swf|xml|mp3|png|jpg|gif|data)$ {
  expires max;
  }

  location ~.*\.(css|js|mx)$ {
  expires 96h;
  }

  location ~ /.svn/ {
  deny all;
  }

  location ~ .*\.php$
  {
    include fastcgi.conf;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    expires off;
  }

  ssl on;
  ssl_certificate /usr/local/nginx/ssl/ea93balk25xh3f9.crt;
  ssl_certificate_key /usr/local/nginx/ssl/9yrt62bv1z4s35la.key;

  access_log /data/logs/sdk.open.test.com.access.log access;
  error_log   /data/logs/sdk.open.test.com.error.log warn;
}

Nginx配置http强制跳转到https的更多相关文章

  1. Nginx 配置 http 强制跳转到 https

    个人真实配置 架构:Nginx 反向代理 + Nginx 前端(LNMP) 在 Nginx 反向代理的 虚拟机主机配置文件中,作如下配置: upstream ilexa_cn { server 192 ...

  2. nginx配置http强制跳转https

    nginx配置http强制跳转https 网站添加了https证书后,当http方式访问网站时就会报404错误,所以需要做http到https的强制跳转设置. 一.采用nginx的rewrite方法 ...

  3. tomcat7.0.55配置HTTP强制跳转到HTTPS

    首先需要配置好HTTPS单向或双向链接 参考: tomcat7.0.55配置单向和双向HTTPS连接(二) 然后编辑tomcat的conf目录下的web.xml 在<welcome-file-l ...

  4. Nginx的https配置记录以及http强制跳转到https的方法梳理

    一.Nginx安装(略)安装的时候需要注意加上 --with-http_ssl_module,因为http_ssl_module不属于Nginx的基本模块.Nginx安装方法: 1 2 # ./con ...

  5. (转)Nginx的https配置记录以及http强制跳转到https的方法梳理

    Nginx的https配置记录以及http强制跳转到https的方法梳理 原文:http://www.cnblogs.com/kevingrace/p/6187072.html 一.Nginx安装(略 ...

  6. 阿里云SLB上http强制跳转到https问题处理

    背景: 最近一客户有一个需求,需要将外网所有http访问请求强制跳转到https,公网出口使用阿里云SLB,证书放在SLB上,SLB后端实例为ECS(webserver)web服务使用nginx, 网 ...

  7. k8s ingress路由强制跳转至https设置

    为ingress配置增加注解(annotations):nginx.ingress.kubernetes.io/ssl-redirect: 'true' 就可以实现http强制跳转至https 不过默 ...

  8. http强制跳转到https

    原文地址:http://m.blog.csdn.net/article/details?id=8549290 需求简介 基于nginx搭建了一个https访问的虚拟主机,监听的域名是test.com, ...

  9. https进行配置以及http跳转到https配置

    https配置: nginx配置 server { listen 443; server_name localhost; ssl on; root html; index index.html ind ...

随机推荐

  1. HTML+js+css实现点击图片弹出上传文件窗口的两种思路

    第一种:CSS实现 <style><!-- .fileInputContainer{        height:256px;        background:url(upfil ...

  2. mysql优化, 删除数据后物理空间未释放(转载)

    mysql优化, 删除数据后物理空间未释放(转载) OPTIMIZE TABLE 当您的库中删除了大量的数据后,您可能会发现数据文件尺寸并没有减小.这是因为删除操作后在数据文件中留下碎片所致.OPTI ...

  3. 网络流(最大流):CodeForces 499E Array and Operations

    You have written on a piece of paper an array of n positive integers a[1], a[2], ..., a[n] and m goo ...

  4. poj3071 Football

    学习位运算在比赛的技巧 http://poj.org/problem?id=3071 Football Time Limit: 1000MS   Memory Limit: 65536K Total ...

  5. hdoj 1260 Tickets【dp】

    Tickets Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Sub ...

  6. kafka配额控制

    转载请注明地址http://www.cnblogs.com/dongxiao-yang/p/5217754.html Starting in 0.9, the Kafka cluster has th ...

  7. html,shtml和htm的区别

    SHTML和HTML的区别,如果用一句话来解释就是:SHTML 不是HTML而是一种服务器 API,shtml是服务器动态产成的html. 虽然两者都是超文本格式,但shtml是一种用于SSI技术的文 ...

  8. http://c7sky.com/works/css3slides/#1

    http://c7sky.com/works/css3slides/#1 css3 学习

  9. 【题解】警位安排( 树形 DP)

    [题目描述]一个重要的基地被分成了 n 个连通的区域 , 出于某种原因 , 这个基地以某一个区域为核心,呈一树形分布.在每个区域里安排警卫的费用是不同的,而每个区域的警卫都可以望见其相邻的区域 .如果 ...

  10. SQL string类型的数据按int类型排序 分类: SQL Server 2014-12-08 16:56 393人阅读 评论(0) 收藏

    说明: 我在做wms进销存软件时,发现一个问题:一张入库单(T_OutIn_BoxTop),入库扫描时要分成多箱,箱号(BoxTop_No)可以是数字也可以是字符串,所以箱号只能是字符串类型的,问题来 ...