user  www www;

worker_processes auto;

error_log  /home/wwwlogs/nginx_error.log  crit;

pid        /usr/local/nginx/logs/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200; events
{
use epoll;
worker_connections 51200;
multi_accept on;
} http
{
include mime.types;
default_type application/octet-stream; server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m; sendfile on;
tcp_nopush on; keepalive_timeout 60; tcp_nodelay on; fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k; gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE [1-6]\."; #limit_conn_zone $binary_remote_addr zone=perip:10m;
##If enable limit_conn_zone,add "limit_conn perip 10;" to server section. server_tokens off;
access_log off;
server {
listen 80;
server_name foams.shop www.foams.shop; return 301 https://$server_name$request_uri;
} server
{
listen 443;
#listen [::]:80 default_server ipv6only=on;
server_name foams.shop www.foams.shop;
if ( $host != 'www.foams.shop' ) {
rewrite ^/(.*)$ https://www.foams.shop/$1 permanent;
}
index index.html index.htm index.php;
root /home/wwwroot/default;
     
      #证书配置开始
ssl on;#lnmp1.5之后的版本这行可以去掉 ssl_certificate /usr/local/nginx/cert/ssl.pem;#路劲,根据自己位置修改
ssl_certificate_key /usr/local/nginx/cert/ssl.key;#路劲,根据自己位置修改
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
    #证书配置结束
#error_page 404 /404.html; # Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; } include enable-php.conf;
location / {
try_files $uri $uri/ /index.php?$query_string;
} location /nginx_status
{
stub_status on;
access_log off;
} location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
} location ~ .*\.(js|css)?$
{
expires 12h;
} location ~ /.well-known {
allow all;
} location ~ /\.
{
deny all;
} access_log /home/wwwlogs/access.log;
}
include vhost/*.conf;
}

  以上环境是 lnmp1.5 和阿里云ssl nginx配置

nginx ssl 配置的更多相关文章

  1. Nginx SSL配置

    一.SSL 原理 ① 客户端( 浏览器 )发送一个 https 请求给服务器② 服务器要有一套证书,其实就是公钥和私钥,这套证书可以自己生成,也可以向组织申请,服务器会把公钥传输给客户端③ 客户端收到 ...

  2. Nginx SSL配置过程

    1. 在godaddy购买了UCC SSL(最多5个域名)的SSL证书 2. 设置证书 -- 管理 -- 3. 需要制作证书申请CSR文件(在线工具制作或者openssl命令制作),保存CSR和key ...

  3. nginx - ssl 配置 - globelsign ssl

    前提: 3个文件 - domain.csr.domain.key.xxx.cer 简述: 1. 本地生成 .key文件  [附件] 2. 再利用key文件,生成csr(certificate Secu ...

  4. nginx + SSL优化配置

    nginx + SSL优化配置: #http段添加如下配置项: http { ssl_prefer_server_ciphers on; #设置协商加密算法时,优先使用我们服务端的加密套件,而不是客户 ...

  5. Tomcat的SSL证书配置以及Tomcat+Nginx实现SSL配置

    把jks上传到java容器在的服务器上,路径只要不是webapps下就可以,然后到conf目录下server.xml里配置 <Connector port=" protocol=&qu ...

  6. Ubuntu Nginx下配置网站ssl实现https访问

    最近在看  HTTP权威指南   看到介绍了HTTPS的ssl,自己就动手测试了下,将步骤记录下 HTTPS简介 什么是HTTPS?百科是这样解释的.HTTPS(全称:Hyper Text Trans ...

  7. nginx反向代理cas server之1:多个cas server负载均衡配置以及ssl配置

    系统环境采用centOS7 由于cas server不支持session持久化方式的共享,所以请用其他方式代替,例如:组播复制. 为什么不支持session持久化:http://blog.csdn.n ...

  8. nginx普通配置/负载均衡配置/ssl/https配置

    1.nginx普通配置 server { listen ; server_name jqlin.lynch.com; access_log /var/log/nginx/main.log main; ...

  9. Linux下Nginx安全证书ssl配置方法

    分享下我是如何一步步在Nginx上配置SSL的.首先,确保安装了OpenSSL库,并且安装Nginx时使用了–with-http_ssl_module参数. 初学者或者菜鸟建议使用LNMP进行一键安装 ...

随机推荐

  1. angular 定时函数

    注入$interval,$timeout   服务 2.定义函数 var aa = $interval(function(){ $timout(function(){ ..... }) },,定时时间 ...

  2. 介绍一下Spring Cloud Config

    Spring Cloud Config为分布式系统中的外部配置提供服务器和客户端支持.使用Config Server,您可以在所有环境中管理应用程序的外部属性.客户端和服务器上的概念映射与Spring ...

  3. 重新复习~ 为了重新找工作 - > XMLHttpRequest2.0 Jsonp nodeType 节点 webpack基本搭建 闭包的一句话总结

    XMLHttpRequest2.0 1.可以设置超时 (xhr.timeout = 1000; ontimeout()函数) 2.支持FormData对象管理表单数据(new FormData 方法: ...

  4. java中的异常处理问题。

    异常处理--基本概念 当出现程序无法控制的外部环境问题(用户提供的文件不存在,文件内容损坏,网络不可用...)时,JAVA就会用异常对象来描述. java中用2种方法处理异常: 1.在发生异常的地方直 ...

  5. elasticsearch(5) 请求体搜索

    上一篇提到的轻量搜索非常简单便捷,但是通过请求体查询可以更充分的利用查询的强大功能.因为_search api中大部分参数是通过HTTP请求体而非查询字符串来传递的. 一 空查询 对于空查询来说,最简 ...

  6. Dangerous well

    Firsttime to develop games throuth Unity3d, such a great platform! You can build your games more qui ...

  7. How to automate Microsoft Word to create a new document by using Visual C#

    How to automate Microsoft Word to create a new document by using Visual C# For a Microsoft Visual Ba ...

  8. 在Servlet中获取spring容器WebApplicationContext

    WebApplicationContext springContext = WebApplicationContextUtils.getRequiredWebApplicationContext(ge ...

  9. Java程序心得体会

    学习Java是一件快乐的事情,刚开始学习的时候还有点难,后来慢慢熟悉了Java的程序操作,在错误中获得技巧,一次又一次的失败,让我对Java产生了兴趣,现在对Java既陌生又熟悉,我相信我会喜欢上Ja ...

  10. 【原创】Proxmark3系列教程1——PM3用法

    1 PM3介绍 proxmark3是一款开源的RFID安全研究平台黑色按钮从图中我们可以看到左上方有一颗黑色按钮,这个按钮就是Proxmark3的功能键,主要用于启动嗅探模式以及停止进程功能,其中内置 ...