Not really a bug, since it’s not Discourse’s fault at all, so I figured I’d stick this in support.
Flipped on Google/Yahoo/Twitter authentication today at the request of a user, and because eh, why not—I personally would never use it, but I don’t have to It took a while to figure out exactly what had to go where on dev.twitter.com to make stuff work, but I eventually found all the right fields to fill out, thanks to to past postings here on meta.
Ran into one final issue, when actually attempting to log on with a Twitter account. The initial request to grant access to my twitter account went fine, and I saw the correct Twitter-provided username & password window. However, after entering credentials and requesting access, I got a blank page served up by my web server. It looked like the page title had twitter authentication stuff in it, and it was coming from port 8881.
I figured this problem must have something to do with Varnish and Nginx; I run my instance of Nginx on port 8881, with Varnish listening on port 80 and passing/piping/caching requests as needed. Fortunately, I didn’t have to figure out the problem myself, as some kind soul had already done so.
For future reference, the problem was that Passenger needed to be made aware that it should pretend it’s on port 80. I added the following line in the server sections (both http and https) of my Nginx Discourse virtual host configuration:
passenger_set_cgi_param SERVER_PORT 80;
Problem solved! Twitter authentication now works correctly. Hope this is helpful to someone
You are probably missing a curly brace—or you have one too many. In the error message you mention, nginx is telling you that the problem is on line 8 in nginx.conf. Look and see what’s on that line.
Also, if you’re using virtual host files for nginx (maybe in /etc/nginx/conf.d?), the passenger param should be set there, with the Discourse virtual host, because otherwise the param won’t be applied correctly. You can have multiple server blocks, and IIRC that param will only apply to the server block where it’s set, rather than globally. In other words, I’m pretty sure that setting it in an empty server block does absolutely nothing.
I’d recommend taking a closer look at your nginx configuration so you can understand exactly how your Discourse site is set up.