heberoxx 发表于 2018-12-4 10:22:52

Nginx+Tomcat SSL配置指南|Nginx+Tomcat+centos

  验证配置 :访问 https://127.0.1.1:8443/
  三。综合配置
  前段静态内容处理:nginx 配置
  http {
  include       /etc/nginx/mime.types;
  default_typeapplication/octet-stream;
  log_formatmain'$remote_addr - $remote_user [$time_local] "$request" '
  '$status $body_bytes_sent "$http_referer" '
  '"$http_user_agent" "$http_x_forwarded_for"';
  access_log/var/log/nginx/access.logmain;
  sendfile      on;
  tcp_nopush      on;
  tcp_nodelay   on;
  server_tokens   off;
  gzip            on;
  gzip_static   on;
  gzip_comp_level 5;
  gzip_min_length 1024;
  keepalive_timeout65;
  limit_zone   myzone$binary_remote_addr10m;
  # Load config files from the /etc/nginx/conf.d directory
  include /etc/nginx/conf.d/*.conf;
  server {
  listen       80;
  server_namelocalhost;
  location ~ .(htm|html|gif|jpg|jpeg|png|ico|rar|css|js|zip|txt|flv|swf|doc|ppt|xls|pdf)$ {
  index index.jsp index.html;
  root /home/tomcat/webapps;
  access_log off;
  expires 24h;
  }#nginx处理静态内容
  location /{
  proxy_pass http://127.0.0.1:8080; #提交给后端的tomcat处理
  }
  }

页: [1]
查看完整版本: Nginx+Tomcat SSL配置指南|Nginx+Tomcat+centos