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

SSO Redirection - Connection Refused error #22

Open
vijiv6190 opened this issue Nov 9, 2023 · 2 comments
Open

SSO Redirection - Connection Refused error #22

vijiv6190 opened this issue Nov 9, 2023 · 2 comments

Comments

@vijiv6190
Copy link

Hi,

I have OpenIDC configuration to add SSO before redirection. It is getting successful response from SSO and while redirecting to proxy pass url I am facing below connection refused error. Can you please suggest if I am missing any configuration.

Note: No connection issue while performing proxy pass without SSO.

          OpenIDCConfig redirect_uri=<uri>;
            OpenIDCProvider file /etc/nginx/openidc_duo.json;
            OpenIDCClient string client_id=<Client_id>&client_secret=<client secret>&scope=openid%20profile&token_endpoint_auth_method=client_secret_basic ssl_verify=true;
              OpenIDCClaim sub $pfc_claim_sub;
            proxy_set_header AUTH_USER $pfc_claim_sub;

location has below proxy pass configurations
location /uri
{
proxy_pass <proxy_pass_url>;
proxy_set_header Origin "" ;
proxy_set_header X-Forwarded-Host $host:$server_port;
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_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
}

2023/11/09 15:16:44 [error] 242395#0: *3070 connect() failed (111: Connection refused) while connecting to upstream, client: xx.xx.xxx.xx, server: , request: "GET /uri/?code=484dbdbb7a144370ae3852feb4779130&state=cbbdfce20cd631a2 HTTP/1.1", upstream: "http://xxx.xxx.xxx:xxx/?code=484dbdbb7a144370ae3852feb4779130&state=cbbdfce20cd631a2", host: "xx.xx.xxx.xx"

@zandbelt
Copy link
Member

zandbelt commented Nov 9, 2023

it seems you're encountering an unintended side effect of combining proxy_pass with the redirect_uri location; you may have to configure the redirect URI to a value that is not proxied, e.g. /redirect_uri, perhaps better, leave it to the default setting /openid-connect/redirect_uri

@vijiv6190
Copy link
Author

vijiv6190 commented Nov 9, 2023

With default setting /openid-connect/redirect_uri , can I acheive proxy_pass? What would be the configuration for that?

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