nginx代理knife4j接口文档

nginx配置(11215是服务的端口信息)

location ~* ^(/v2|/swagger-resources|/swagger-ui|/swagger-ui/index.html|/webjars/|/favicon.ico/|/doc.html) {
			proxy_redirect off;
			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 $scheme;
			proxy_pass http://127.0.0.1:11215;
			proxy_set_header X-Forwarded-Host $host;
			proxy_set_header X-Forwarded-Port $server_port;
		}

  

访问地址

http://192.168.5.6:11215/doc.html#/home

nginx代理后的访问地址

http://192.168.5.6/doc.html#/home

 

posted on 2023-12-09 20:48  james-roger  阅读(372)  评论(0编辑  收藏  举报