传统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;

        }


    }

  

猜你喜欢

转载自www.cnblogs.com/yun965861480/p/10885157.html
0条评论
添加一条新回复