Score:0

Nginx configuration for oauth2-proxy and code-server

am flag

I am trying to set up oauth2-server to set up GitHub authentication before reaching my code-server. I am using Nginx and Cert bot to deploy the server.

This is what I have configured in Nginx to connect to the oauth2-proxy

location / {
   proxy_pass http://127.0.0.1:4180;
   proxy_set_header Host $host;
   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;
}

The site example.tld successfully loads and allows the user to authenticate with GitHub, but then throw a redirect_uri_mismatch error, and I'm unsure why.

This is what I have configured in my oauth2-proxy config

client_id = "12345"
client_secret = "secret"
cookie_secret = "secret"
redirect_url = "http://127.0.0.1:4180/oauth2/callback/"
upstreams = ["http://127.0.0.1:8080/"]
cookie_secure = true
provider = "github"
proxy_websockets = true
github_repo = "repo"
reverse_proxy = true
email_domains = "*"

If anybody could help me pinpoint the problem and help me correct it, that would be appreciated. Thank you in advance!

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.