Java Nginx后的Spring引导中的Oauth2 oauth/token端点问题
我正在Nginx代理服务器后面部署springboot应用程序。每当我尝试使用此端点对用户进行身份验证时,都不会得到任何响应 这是我的Java Nginx后的Spring引导中的Oauth2 oauth/token端点问题,java,spring-boot,docker,nginx,lets-encrypt,Java,Spring Boot,Docker,Nginx,Lets Encrypt,我正在Nginx代理服务器后面部署springboot应用程序。每当我尝试使用此端点对用户进行身份验证时,都不会得到任何响应 这是我的应用程序。属性 spring.profiles.active=prod server.port=8088 server.tomcat.remote-ip-header= X-Forwarded-For server.tomcat.protocol-header= X-Forwarded-Proto #server.servlet.context-path=/ A
应用程序。属性
spring.profiles.active=prod
server.port=8088
server.tomcat.remote-ip-header= X-Forwarded-For
server.tomcat.protocol-header= X-Forwarded-Proto
#server.servlet.context-path=/
API.URL=/api/v1
这是WebSecurityConfigureAdapter中的配置方法
@Override
protected void configure(HttpSecurity http) throws Exception {
logger.debug("configure");
System.out.println("configure ");
http.requiresChannel().anyRequest().requiresSecure();
http
.authorizeRequests()
.antMatchers("/").permitAll()
.and()
.authorizeRequests()
.anyRequest()
.authenticated()
;
}
这是我的nginx配置文件
server {
listen 80;
server_name myserver.com;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
server_name myserver.com;
ssl_certificate /etc/letsencrypt/live/myserver.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/myserver.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/myserver.com/fullchain.pem;
location / {
proxy_pass http://myserver:8088;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
我可以访问其他端点,但不能访问oauth/token
。我正在使用AmazonEC2实例
当我试图在《邮差》中达到终点时,我得到了
Error: connect ETIMEDOUT some_ip_that_is_not_ec2_ip:443
Warning: This request did not get sent completely and might not have all the required system headers
当我尝试使用Okhttp访问端点时,我得到
Server: nginx/1.17.8
Content-Type: text/html
Content-Length: 157
Connection: close
<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx/1.17.8</center>
</body>
</html>
服务器:nginx/1.17.8
内容类型:text/html
内容长度:157
连接:关闭
400错误请求
400错误请求
nginx/1.17.8
任何帮助都将不胜感激。谢谢您能解决此问题吗?您能解决此问题吗?