检索服务
一.search项目
1. 搭建检索服务
1.1 添加thymeleaf依赖
<!-- thymeleaf模板引擎 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
1.2 index.html文件放入项目
1).把index.html文件放入项目的资源的template下

2).修改index的文件路径/static/search

1.3 把静态资源放入nginx
1).nginx的static下创建search文件夹

2). 把静态文件放入search下

1.4 修改search的域名转发
1).打开SwitchHosts.exe(管理员权限)

2).修改search域名转发

3) 配置nginx关于search

3.1).nginx配置如下

4).修改search网关配置

5)nginx转发效果

6).测试,是否转发到search的index.html页面(ok)

7).页面跳转(点击search图标、生成首页 跳转到商品首页)
http://search.gulimall.com ----> http://gulimall.com
7.1). 修改search的index.html


7.2). 修改nginx的配置文件gulimall.conf

7.3).测试ok
http://search.gulimall.com ----> http://gulimall.com
1.5.商品项目,实现 点击商品分类、搜索框 跳转搜索search页面
1).实现点击商品分类 跳转搜索search页面

2).实现点击搜索框 跳转搜索search页面

3).问题:解决nginx中js修改不生效的问题
解决方法:修改nginx.conf , 将sendfile 设置为 off

重启nginx,清理浏览器缓存
480

被折叠的 条评论
为什么被折叠?



