Swagger-ui可以在“开发”环境中访问,但是当我将其部署到云中时失败。
我尝试了AddResoucesHandler,
,但是它不起作用。
错误消息:
GET
https://user.throw.atatakai.cn/webjars/springfox-swagger-ui/springfox.css?v=2.9.2
net::ERR_ABORTED 404 (Not Found) swagger-ui.html:8 GET
https://user.throw.atatakai.cn/webjars/springfox-swagger-ui/swagger-ui.css?v=2.9.2
net::ERR_ABORTED 404 (Not Found) swagger-ui.html:70 GET
https://user.throw.atatakai.cn/webjars/springfox-swagger-ui/swagger-ui-bundle.js?v=2.9.2
net::ERR_ABORTED 404 (Not Found) swagger-ui.html:71 GET
https://user.throw.atatakai.cn/webjars/springfox-swagger-ui/swagger-ui-standalone-preset.js?v=2.9.2
net::ERR_ABORTED 404 (Not Found) swagger-ui.html:72 GET
https://user.throw.atatakai.cn/webjars/springfox-swagger-ui/springfox.js?v=2.9.2
404 (Not Found)
和nginx错误日志
2019/04/24 21:09:36 [error] 28774#0: *212397 connect() failed (111: Connection refused) while connecting to upstream, client: 125.90.49.14, server: user.throw.atatakai.cn, request: "GET /swagger-ui.html HTTP/1.1", upstream: "http://127.0.0.1:8099/swagger-ui.html", host: "user.throw.atatakai.cn"
2019/04/24 21:09:36 [error] 28774#0: *212397 connect() failed (111: Connection refused) while connecting to upstream, client: 125.90.49.14, server: user.throw.atatakai.cn, request: "GET /swagger-ui.html HTTP/1.1", upstream: "http://127.0.0.1:8099/502.html", host: "user.throw.atatakai.cn"
2019/04/24 21:09:37 [error] 28774#0: *212397 connect() failed (111: Connection refused) while connecting to upstream, client: 125.90.49.14, server: user.throw.atatakai.cn, request: "GET /swagger-ui.html HTTP/1.1", upstream: "http://127.0.0.1:8099/swagger-ui.html", host: "user.throw.atatakai.cn"
2019/04/24 21:09:37 [error] 28774#0: *212397 connect() failed (111: Connection refused) while connecting to upstream, client: 125.90.49.14, server: user.throw.atatakai.cn, request: "GET /swagger-ui.html HTTP/1.1", upstream: "http://127.0.0.1:8099/502.html", host: "user.throw.atatakai.cn"
[root@huizekeji user.throw.atatakai.cn]# cat /www/wwwlogs/user.throw.atatakai.cn.error.log
2019/04/24 21:09:36 [error] 28774#0: *212397 connect() failed (111: Connection refused) while connecting to upstream, client: 125.90.49.14, server: user.throw.atatakai.cn, request: "GET /swagger-ui.html HTTP/1.1", upstream: "http://127.0.0.1:8099/swagger-ui.html", host: "user.throw.atatakai.cn"
2019/04/24 21:09:36 [error] 28774#0: *212397 connect() failed (111: Connection refused) while connecting to upstream, client: 125.90.49.14, server: user.throw.atatakai.cn, request: "GET /swagger-ui.html HTTP/1.1", upstream: "http://127.0.0.1:8099/502.html", host: "user.throw.atatakai.cn"
2019/04/24 21:09:37 [error] 28774#0: *212397 connect() failed (111: Connection refused) while connecting to upstream, client: 125.90.49.14, server: user.throw.atatakai.cn, request: "GET /swagger-ui.html HTTP/1.1", upstream: "http://127.0.0.1:8099/swagger-ui.html", host: "user.throw.atatakai.cn"
2019/04/24 21:09:37 [error] 28774#0: *212397 connect() failed (111: Connection refused) while connecting to upstream, client: 125.90.49.14, server: user.throw.atatakai.cn, request: "GET /swagger-ui.html HTTP/1.1", upstream: "http://127.0.0.1:8099/502.html", host: "user.throw.atatakai.cn"
2019/04/24 21:11:06 [error] 28774#0: *212415 connect() failed (111: Connection refused) while connecting to upstream, client: 217.182.175.162, server: user.throw.atatakai.cn, request: "HEAD /webjars/springfox-swagger-ui/swagger-ui-standalone-preset.js?v=2.9.2 HTTP/1.1", upstream: "http://127.0.0.1:8099/404.html", host: "user.throw.atatakai.cn"
2019/04/24 21:11:06 [error] 28774#0: *212416 connect() failed (111: Connection refused) while connecting to upstream, client: 217.182.175.162, server: user.throw.atatakai.cn, request: "HEAD /webjars/springfox-swagger-ui/swagger-ui.css?v=2.9.2 HTTP/1.1", upstream: "http://127.0.0.1:8099/404.html", host: "user.throw.atatakai.cn"
2019/04/24 21:11:07 [error] 28774#0: *212419 connect() failed (111: Connection refused) while connecting to upstream, client: 217.182.175.162, server: user.throw.atatakai.cn, request: "HEAD /webjars/springfox-swagger-ui/swagger-ui-bundle.js?v=2.9.2 HTTP/1.1", upstream: "http://127.0.0.1:8099/404.html", host: "user.throw.atatakai.cn"
2019/04/24 21:11:07 [error] 28774#0: *212420 connect() failed (111: Connection refused) while connecting to upstream, client: 217.182.175.162, server: user.throw.atatakai.cn, request: "HEAD /webjars/springfox-swagger-ui/springfox.js?v=2.9.2 HTTP/1.1", upstream: "http://127.0.0.1:8099/404.html", host: "user.throw.atatakai.cn"
2019/04/24 21:11:08 [error] 28774#0: *212421 connect() failed (111: Connection refused) while connecting to upstream, client: 217.182.175.162, server: user.throw.atatakai.cn, request: "HEAD /webjars/springfox-swagger-ui/springfox.css?v=2.9.2 HTTP/1.1", upstream: "http://127.0.0.1:8099/404.html", host: "user.throw.atatakai.cn"
2019/04/24 21:14:19 [error] 28774#0: *212425 connect() failed (111: Connection refused) while connecting to upstream, client: 125.90.49.14, server: user.throw.atatakai.cn, request: "GET /swagger-ui.html HTTP/1.1", upstream: "http://127.0.0.1:8099/swagger-ui.html", host: "user.throw.atatakai.cn"
2019/04/24 21:14:19 [error] 28774#0: *212425 connect() failed (111: Connection refused) while connecting to upstream, client: 125.90.49.14, server: user.throw.atatakai.cn, request: "GET /swagger-ui.html HTTP/1.1", upstream: "http://127.0.0.1:8099/502.html", host: "user.throw.atatakai.cn"