zoukankan      html  css  js  c++  java
  • nginx + tomcat = http && https

    Tomcat版块配置:

    vim /tomcat9/to/path/conf/server.xml

    <Server port="8006" shutdown="SHUTDOWN">

    配完上面的并不算完,还有数据库、redis需要配置连接:

     Tomcat版块配置完毕................

    Nginx版块配置:

    server {
      listen 80;
      server_name [ Domain Name ];
      location / {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        proxy_pass http://127.0.0.1:8007;
      }
    }

    server {
      listen 443 ssl;
      server_name [ Domain Name ];
      ssl_certificate /usr/local/nginx/cert/applets.pem;
      ssl_certificate_key /usr/local/nginx/cert/applets.key;
      ssl_session_cache shared:SSL:1m;
      ssl_session_timeout 5m;

      ssl_ciphers HIGH:!aNULL:!MD5;
      ssl_prefer_server_ciphers on;
      location / {
        client_max_body_size 16m;
        client_body_buffer_size 128k;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto https;
        proxy_redirect off;
        proxy_connect_timeout 240;
        proxy_read_timeout 240;
        proxy_send_timeout 240;

        proxy_pass http://127.0.0.1:8007;
      }
    }

  • 相关阅读:
    JMM简述
    spring简读
    Linux常用命令
    基于java的八大排序实现
    数据库事务说明
    BIO、NIO、AIO区别与联系
    ThreadLocal 是什么?有哪些使用场景?
    ConcurrentHashMap 和 Hashtable 比较,为什么推荐使用ConcurrentHashMap?
    sychronized设计原理
    MySQL索引详解
  • 原文地址:https://www.cnblogs.com/smlile-you-me/p/10556612.html
Copyright © 2011-2022 走看看