# Discouse passes localhost uri as oauth redirect\_uri

**URL:** <https://meta.discourse.org/t/discouse-passes-localhost-uri-as-oauth-redirect-uri/32905>\
**Category:** Product Support\
**Created:** [9월 4, 2015, 12:06오후 UTC](https://meta.discourse.org/t/discouse-passes-localhost-uri-as-oauth-redirect-uri/32905 "2015-09-04T12:06:53Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![marijn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marijn/32/115107_2.png) [@marijn](https://meta.discourse.org/u/marijn)\
**Post date:** [9월 4, 2015, 12:06오후 UTC](https://meta.discourse.org/t/discouse-passes-localhost-uri-as-oauth-redirect-uri/32905/1 "2015-09-04T12:06:53Z")

</div>

I’ve set up what should be a vanilla Docker-based Discourse install (except that I’ve imported an existing database from another, non-Docker install). Things mostly work, but OAuth via github (as well as twitter) fails with a `message=redirect_uri_mismatch` error. Inspecting the actual packets that are being sent over, I see this in the url:

```
redirect_uri=http%3A%2F%2Flocalhost%3A6080%2Fauth%2Fgithub%2Fcallback

```

So that explains that error message. What can I do to make Discourse use its real url (`discuss.codemirror.net` in this case)?

Edit: Forgot to mention, the container isn’t directly binding port 80/443, but being proxied through an nginx, since the host serves other sites as well.

---

_[View the full topic](https://meta.discourse.org/t/discouse-passes-localhost-uri-as-oauth-redirect-uri/32905)._
