nginx配置https
来源:互联网 发布:daum potplayer mac版 编辑:程序博客网 时间:2024/04/30 12:49
#yum install gcc gcc-c++ openssl openssl-devel
搭建nginx
#useradd www -s /sbin/nologin
#tar -zxf pcre-8.12.tar.gz
#cd pcre-8.12
#./configure
#make && make install
#cd ../nginx-1.7.1
#./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module
#make && make install
#cd /usr/local/nginx/conf
#openssl genrsa -des3 -out server.key 1024
//生成一个RSA密钥
#openssl req -new -key server.key -out server.csr
//生成一个证书请求(CSR)
#openssl rsa -in server.key -out server_nopwd.key
//拷贝一个不需要输入密码的密钥文件
#openssl x509 -req -days 365 -in server.csr -signkey server_nopwd.key -out server.crt
//自己签发证书
配置nginx虚拟主机
server {
listen 443;
ssl on;
ssl_certificate /usr/local/nginx/conf/server.crt;
ssl_certificate_key /usr/local/nginx/conf/server_nopwd.key;
server_name localhost;
index index.php index.html;
root /data/htdocs/index;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
location ~ .*\.(js|css)?$ {
expires 1h;
}
access_log /data/logs/www/test_access.log www;
error_log /data/logs/www/test_error.log;
}
搭建nginx
#useradd www -s /sbin/nologin
#tar -zxf pcre-8.12.tar.gz
#cd pcre-8.12
#./configure
#make && make install
#cd ../nginx-1.7.1
#./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module
#make && make install
#cd /usr/local/nginx/conf
#openssl genrsa -des3 -out server.key 1024
//生成一个RSA密钥
#openssl req -new -key server.key -out server.csr
//生成一个证书请求(CSR)
#openssl rsa -in server.key -out server_nopwd.key
//拷贝一个不需要输入密码的密钥文件
#openssl x509 -req -days 365 -in server.csr -signkey server_nopwd.key -out server.crt
//自己签发证书
配置nginx虚拟主机
server {
listen 443;
ssl on;
ssl_certificate /usr/local/nginx/conf/server.crt;
ssl_certificate_key /usr/local/nginx/conf/server_nopwd.key;
server_name localhost;
index index.php index.html;
root /data/htdocs/index;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
location ~ .*\.(js|css)?$ {
expires 1h;
}
access_log /data/logs/www/test_access.log www;
error_log /data/logs/www/test_error.log;
}
0 0
- Nginx(12):nginx配置https
- nginx 配置https server
- nginx 配置https
- Nginx 配置 https 加密
- Nginx配置https服务器
- Ubuntu nginx 配置https
- nginx https配置
- nginx配置https
- nginx 配置https
- nginx 配置HTTPS服务器
- Linux nginx配置https
- nginx 配置https 环境
- Nginx配置Https
- nginx配置https
- Nginx配置https访问
- nginx配置https服务
- nginx配置https方法
- nginx配置https
- FUEL8安装处理
- 79. Word Search&矩阵中的路径
- Nginx利用rewrite进行文件转移
- sencha touch 动态加载外部js
- maven 生成可运行的jar
- nginx配置https
- 剑指 offer——面试题8求旋转数组的最小值
- 对hibernate的简单理解
- wget指定文件,指定目录,指定路径下载
- 上线 之 上架AppStore10个大坑(上)
- iOS开发 ☞ 数组常用方法
- android 6.0 SystemUI源码分析(2)-SystemUI启动流程
- [转载]微服务实战(一):微服务架构的优势与不足
- Runtime那些事儿(消息机制)