github oauth and nginx proxy github oauth and nginx proxy nginx nginx

github oauth and nginx proxy


The error isn't coming from nginx, it's coming from your OAuth provider:

The redirect_uri parameter is optional. If left out, GitHub will redirect users to the callback URL configured in the OAuth Application settings. If provided, the redirect URL's host and port must exactly match the callback URL. The redirect URL's path must reference a subdirectory of the callback URL.

-- https://developer.github.com/v3/oauth/#redirect-urls


This is an old question, but...

Try changing your Host header to

proxy_set_header Host $host:$server_port

This may or may not work depending on your application.

As an aside, X-Forwarded-For should include a comma-separated list of the originating client and any proxies it passes through.