2019年3月19日
摘要: 第一步:server配置,指向负载均衡upstream1 server { listen 80; server_name www.xxx.com; location / { proxy_pass http://upstream1 使用哪个负载均衡 proxy_set_header Host $Hos 阅读全文
posted @ 2019-03-19 15:38 梦幻朵颜 阅读(437) 评论(0) 推荐(0) 编辑
摘要: 假设下面四种情况分别用 http://192.168.1.1/proxy/test.html 进行访问。 第一种:location /proxy/ { proxy_pass http:// 127.0.0.1/; 一般情况下不要在最后加上/,因为会去掉请求URL一部分。}代理到URL:http:// 阅读全文
posted @ 2019-03-19 15:09 梦幻朵颜 阅读(698) 评论(0) 推荐(0) 编辑
摘要: //如果这个启动类所在的包路径隐藏的很深,则需要指定扫描包。否则默认扫描启动类所在的子包路径下 @SpringBootApplication(scanBasePackages="com.joyce.users") public class MyApplication{ public static void main(String[] args){ Spr... 阅读全文
posted @ 2019-03-19 11:15 梦幻朵颜 阅读(5447) 评论(0) 推荐(0) 编辑
摘要: pom.xml配置添加main启动类: 到项目根目录下,执行cmd命令: mvn clean package -Dmaven.test.skip=true //先clean清除target目录下已经存在的jar或war或其他文件,然后package打包形成 jar 或 war,但不 install到 阅读全文
posted @ 2019-03-19 10:49 梦幻朵颜 阅读(16208) 评论(0) 推荐(1) 编辑