# Session/sso wrong redirect

**URL:** https://meta.discourse.org/t/session-sso-wrong-redirect/46103
**Category:** Support
**Created:** [June 21, 2016, 5:58am UTC](https://meta.discourse.org/t/session-sso-wrong-redirect/46103 "2016-06-21T05:58:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![iamntz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamntz/32/114670_2.png) [@iamntz](https://meta.discourse.org/u/iamntz)
#### Post date: [June 21, 2016, 5:58am UTC](https://meta.discourse.org/t/session-sso-wrong-redirect/46103/1 "2016-06-21T05:58:25Z")

</div>

Hey guys.

I have this weird thing and I’m not sure what to do next. So, I have this set up:

- Discourse behind nginx, because I have a couple of extra sites on the same sever.
- The forum is private, on a subdomain
- The auth is made via [wp sso](https://meta.discourse.org/t/wp-discourse-sso-plugin), on the same server, as a main domain
- When I’m not auth and try to access discourse, it will redirect me to discourse.mysite.comsession/sso.

Obviously, this will fail, there is a slash missing in the URL.

```plaintext
$ curl -I discourse.mysite.com
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Tue, 21 Jun 2016 05:38:23 GMT
Content-Type: text/html
Content-Length: 178
Connection: keep-alive
Location: https://discourse.mysite.com/

$ curl -L discourse.mysite.com
curl: (6) Could not resolve host: discourse.mysite.comsession

```

Inside of wp sso, i had specified the url with a trailing slash, yet no results..

At this point I’m not sure what to try first, because I have no idea when this issue appeared and if this is the result of the fact that i use the same server for multiple sites.

Any ideas?

Thanks!

---

<div class="post-metadata">

### Author: ![iamntz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamntz/32/114670_2.png) [@iamntz](https://meta.discourse.org/u/iamntz)
#### Post date: [June 23, 2016, 7:56am UTC](https://meta.discourse.org/t/session-sso-wrong-redirect/46103/2 "2016-06-23T07:56:44Z")

</div>

I found the problem.

In the proxy nginx i had this thing:

```plaintext
proxy_redirect http://discourse.mysite.com:8820/ https://discourse.mysite.com;

```

Seems that something is missing? No? It is, the final slash is not there!

I added and everything looks just fine! Yay.

```plaintext
proxy_redirect http://discourse.mysite.com:8820/ https://discourse.mysite.com/;

```

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:45pm UTC](https://meta.discourse.org/t/session-sso-wrong-redirect/46103/3 "2024-06-08T12:45:29Z")

</div>

This topic was automatically closed after 2909 days. New replies are no longer allowed.
