Session/sso wrong redirect

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, 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.

$ 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!

I found the problem.

In the proxy nginx i had this thing:

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.

proxy_redirect  http://discourse.mysite.com:8820/ https://discourse.mysite.com/;
4 Likes