Nginx配置http强制跳转到https
目的:访问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的更多相关文章
- Nginx 配置 http 强制跳转到 https
个人真实配置 架构:Nginx 反向代理 + Nginx 前端(LNMP) 在 Nginx 反向代理的 虚拟机主机配置文件中,作如下配置: upstream ilexa_cn { server 192 ...
- nginx配置http强制跳转https
nginx配置http强制跳转https 网站添加了https证书后,当http方式访问网站时就会报404错误,所以需要做http到https的强制跳转设置. 一.采用nginx的rewrite方法 ...
- tomcat7.0.55配置HTTP强制跳转到HTTPS
首先需要配置好HTTPS单向或双向链接 参考: tomcat7.0.55配置单向和双向HTTPS连接(二) 然后编辑tomcat的conf目录下的web.xml 在<welcome-file-l ...
- Nginx的https配置记录以及http强制跳转到https的方法梳理
一.Nginx安装(略)安装的时候需要注意加上 --with-http_ssl_module,因为http_ssl_module不属于Nginx的基本模块.Nginx安装方法: 1 2 # ./con ...
- (转)Nginx的https配置记录以及http强制跳转到https的方法梳理
Nginx的https配置记录以及http强制跳转到https的方法梳理 原文:http://www.cnblogs.com/kevingrace/p/6187072.html 一.Nginx安装(略 ...
- 阿里云SLB上http强制跳转到https问题处理
背景: 最近一客户有一个需求,需要将外网所有http访问请求强制跳转到https,公网出口使用阿里云SLB,证书放在SLB上,SLB后端实例为ECS(webserver)web服务使用nginx, 网 ...
- k8s ingress路由强制跳转至https设置
为ingress配置增加注解(annotations):nginx.ingress.kubernetes.io/ssl-redirect: 'true' 就可以实现http强制跳转至https 不过默 ...
- http强制跳转到https
原文地址:http://m.blog.csdn.net/article/details?id=8549290 需求简介 基于nginx搭建了一个https访问的虚拟主机,监听的域名是test.com, ...
- https进行配置以及http跳转到https配置
https配置: nginx配置 server { listen 443; server_name localhost; ssl on; root html; index index.html ind ...
随机推荐
- HTMLTestRunner生成空白resault.html
发现一奇葩问题,用idle或pyscripter执行脚本,生成的是空白html,通过cmd,进入脚本目录执行python xx.py,却能生成测试报告. HTMLTestRunner 例子 #codi ...
- leetcode排列,求第k个排列
stl 中的下一个排列在写一遍忘了 写个1个多小时,使用递归写的,错误就在我使用一个list保存当前剩下的数,然后利用k/(n-1)!的阶乘就是删除的数字,但进过观察, 比如 list={1,2,3} ...
- UVa11090 Going in Cycle!!
UVa11090 Going in Cycle!! 链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=34650 [思路] ...
- mac上的键盘生活——quicksliver
昨天晚上一直在找mac上的博客客户端,没发现很好的国内支持客户端,却发现了一个新的东西--quicksliver 简单的说,这个就是个快捷键启动方式,这是我在mac上用的最好的一个快捷键启动程序( ...
- SQL Server阻止了对组件xp_cmdshell过程的解决方案
使用SQL tools连接sqlserver时候出现以下问题: SQL Server阻止了对组件xp_cmdshell过程的解决方案错误描述:SQL Server阻止了对组件‘xp_cmdshell’ ...
- debian添加sudo
debian安装好默认没有sudo,都要su到root,感觉很容易手抖打错命令. 于是通过 apt-get install sudo安装sudo 然后就是添加有权限的用户到 /etc/sudoers ...
- SRM 408(1-250pt, 1-500pt)
DIV1 250pt 题意:每天晚上需要点蜡烛,且每晚蜡烛燃烧1cm,第i天晚上需要点i根蜡烛.第一天白天的时候,拥有一些蜡烛,用vector<int>can表示他们的长度,问最多能烧几个 ...
- asterisk 能打电话的配置
若使用的是chan_sip.so模块,则在sip.conf里添加: [10]type=friend;context=phonescontext=publichost=dynamicsecret=123 ...
- openStack 性能开测
- Django中的cookie与session
cookie与session的实现原理 HTTP被设计为”无状态”,每次请求都处于相同的空间中. 在一次请求和下一次请求之间没有任何状态保持,我们无法根据请求的任何方面(IP地址,用户代理等)来识别来 ...