莫大人

传统mvc platform与前后端分离项目smart 共用域名nginx配置

#server {
#         listen     80;
#        server_name  139.129.100.155 rjhaasz.cn;
#        rewrite ^(.*)$  https://$host$1 permanent; 
#        }


  server {
        listen     80;
        listen       443;
        server_name  139.129.100.155 rjhaasz.cn;
        ssl                  on;
        ssl_certificate      cert/server.crt;
        ssl_certificate_key  cert/server.key;        
        ssl_session_timeout  5m;
        ssl_protocols TLSv1;
        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers   on;

        autoindex on; # 显示目录
        autoindex_exact_size on; # 显示文件大小
        autoindex_localtime on; # 显示文件时间

        root "/home/jiujiang/spring-smart-html/";
        index  index.html index.htm;

         location /platform/ {
              client_max_body_size    16m;
              client_body_buffer_size 128k;
              proxy_pass                          http://localhost:8084/platform/;
              proxy_set_header        Host $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 https;
              proxy_next_upstream   off;

              proxy_connect_timeout   30;
              proxy_read_timeout      300;
              proxy_send_timeout      300;
        }

        location /smart/ {
             proxy_pass http://localhost:8080/spring-smart-web/smart/;
             proxy_set_header   Host    $host;
             proxy_set_header   X-Real-IP   $remote_addr;
             proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
             proxy_connect_timeout 300;
             proxy_send_timeout 300;
             proxy_read_timeout 300;

        }


    }

  

posted on 2019-05-18 11:33  莫大人  阅读(297)  评论(0编辑  收藏  举报

导航