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 ...
随机推荐
- KeilC51常用功能模块使用说明
本文档包括单片机系统中常用到的时钟中断.通讯及键盘扫描等模块(见所附源程序)的说明.这些模块使用前后台系统模型.为达到最大的灵活性, 需要在用户工程中定义config.h文件, 在其中定义各模块可选参 ...
- development period
- bzoj1560
首先这种题目肯定是要先排序,以x为第一关键字,y为第二关键字不难想到O(n2)的dp,下面显然要优化不难发现,由于两点的耗费是坐标差的平方的和,不带根号,因此,不难发现一个很有用的性质,如果从A点能到 ...
- 简单的javascript例子
<html> <head> <title>hongmaju</title> <link rel="shortcut icon" ...
- unity3d Human skin real time rendering with blood and water drop effect真实模拟人皮实时渲染之血液和水珠掉落效果
在之前的一篇(链接在此)文章中写了下关于真实模拟皮肤渲染,在此基础之上又想加上血液效果,在洗澡的时候(= =:)又想在skin上加上水珠的效果,所以研究了下,做出来效果感觉还不错,放下效果图: 水珠 ...
- HDOJ1020 Encoding
Problem Description Given a string containing only 'A' - 'Z', we could encode it using the following ...
- leetcode First Missing Positive hashset简单应用
public class Solution { public int firstMissingPositive(int[] A) { HashSet<Integer> hash=new H ...
- ACM2075_A/B
#include<iostream> int main() { using namespace std; int i,j,count; cin>>count; while(co ...
- mvn archetyoe:generate -DarchetypeCatalog=internal
可以使用 $mvn archetype:generate -DarchetypeCatalog=internal archetypeCatalog表示插件使用的archetype元数据,默认值为rem ...
- 部署MongoDB扩展并测试使用php简单连接操作之
1,下载MongoDB数据库扩展介质 wget http://pecl.php.net/get/mongo-1.5.1.tgz 2,tar zxvf mongo-1.5.1.tgz &&am ...