0
    upstream servers {
        server lsso-app:5000 fail_timeout=50s max_fails=5;
    }

server {
    listen 7083 default_server ssl http2;
    listen [::]:7083 ssl http2;

    server_name localhost;
    ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
    ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    location / {
        proxy_pass http://servers;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Host $host:$server_port;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Server $host;
        #proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Auth-Request-Redirect $request_uri;
    }
}

当我在 url github oauth 登录后点击本地 https://localhost:7083/lsso-client 时,我会遇到此错误

[redirect_uri_mismatch] redirect_uri 必须与此应用程序的注册回调 URL 匹配。应用程序点击网址:https ://github.com/login/oauth/authorize?response_type=code&client_id=1de6e5ce9a61fc3d5c1a&scope=read:user&state=M9SkDJq6Jrb07zwBF6aQLpmYN9QGRwpHfNScpLOWoKM%3D&redirect_uri=**http://servers**/lsso-client/login/oauth2/代码/github URL:https://localhost:7083/lsso-client/login/oauth2/code/github?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application .&error_uri=https%3A%2F%2Fdocs.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23redirect-uri-mismatch&state=M9SkDJq6Jrb07zwBF6aQLpmYN9QGRwpHfNScpLOWoKM%3D

URL 中的粗体区域应为 https://localhost:7083,但它仅采用上游变量名称。我正在使用springboot> 2。

4

0 回答 0