Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request gateway 405 #14

Open
liuhaogui opened this issue Mar 24, 2020 · 4 comments
Open

request gateway 405 #14

liuhaogui opened this issue Mar 24, 2020 · 4 comments

Comments

@liuhaogui
Copy link

访问api模块: http://localhost:8081/user/test

{
message: "Hi, this is the Greeter API"
}

但是访问gateway 405
request url : http://localhost:8080/user/test

{
id: "go.micro.client.transport",
code: 500,
detail: "405 Not Allowed: <html> <head><title>405 Not Allowed</title></head> <body bgcolor="white"> <center><h1>405 Not Allowed</h1></center> <hr><center>nginx/1.8.1</center> </body> </html> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> <!-- a padding to disable MSIE and Chrome friendly error page --> ",
status: "Internal Server Error"
}

auth和broker注释掉也报这个错误,请问gateway如何访问其他微服务模块的呢? 谢谢。

@liuhaogui
Copy link
Author

error log

➜  gateway git:(master) ✗ go run main.go api --namespace=go.micro.api
2020/03/24 15:39:38 127.0.0.1:8500
2020/03/24 15:39:38 JWT privateKey: asdf1saf233asdfas3df
2020/03/24 15:39:38 Registering API Default Handler at /
2020/03/24 15:39:38 HTTP API Listening on [::]:8080
2020/03/24 15:39:38 Transport [http] Listening on [::]:56914
2020/03/24 15:39:38 Broker [http] Connected to [::]:56915
2020/03/24 15:39:38 Registry [consul] Registering node: go.micro.api-8e823612-3177-4cec-a81a-9acd11abe7cb





2020/03/24 15:39:47 auth plugin received: /user/test
2020/03/24 15:39:47 jwt path : /user/test
2020/03/24 15:39:47 GET-/user/test
2020/03/24 15:39:47 status code 500
2020/03/24 15:39:47 hystrix breaker err:  status code 500
::1 - - [24/Mar/2020:15:39:47 +0800] "GET /user/test HTTP/1.1" 500 919 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"

@Allenxuxu
Copy link
Owner

https://note.mogutou.xyz/articles/2019/06/24/1561380135633.html
看一下这篇博客, 网关有 jwt 鉴权的。

@liuhaogui
Copy link
Author

@Allenxuxu 谢谢

@Allenxuxu
Copy link
Owner

@Allenxuxu 谢谢

🐶不客气

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants