zoukankan      html  css  js  c++  java
  • https和http共存的nginx简单配置

    server{
    listen 80;
    listen 443 ssl;
    ssl_certificate /usr/local/nginx/ssl/www.demo.com/www.demo.com.cn-ca-bundle.crt;#############ssl证书
    ssl_certificate_key /usr/local/nginx/ssl/www.demo.comwww.demo.com.key;############ssl证书key
    autoindex on;
    #开启读取非nginx标准的用户自定义header(开启header的下划线支持)
    underscores_in_headers on;
    server_namewww.demo.com;
    access_log /usr/local/nginx/logs/access.log combined;
    index index.html index.htm index.jsp index.php;
    #error_page 404 /404.html;

    location / {
    proxy_pass https://www.demo.com:8080;
    add_header Access-Control-Allow-Origin *;
    }
    }

    如果未开启ssl模块,配置https时将会提示错误:

    nginx:[emerg] the 'ssl' parmeter requires ngx_http_ssl_module in /usr/local/conf/xxx.conf :37

    这是因为nginx缺少http_ssl_module模块,编译安装时候带上--with-http_ssl_module配置就行了,如果nginx已经安装了怎么办?

    看下面教程:

    nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_module in ......(http://www.cnblogs.com/kenwar/p/8295907.html)

  • 相关阅读:
    链接Oracle数据库
    Spring boot Mybatis
    Spring Boot 部署
    javaEE应用组件
    maven项目搭建步骤
    Spring Boot中Redis的使用
    Struts2 Hello,Wold
    使用JSON
    Spring中Quartz的配置
    Guice示例
  • 原文地址:https://www.cnblogs.com/kenwar/p/8295799.html
Copyright © 2011-2022 走看看