In an environment utilizing x509 certificate authentication we have all of our apps running over SSL. As a result we had a redirect rule on nginx to rewrite everything from port 80 to port 443. We host several rails apps as sub-URI applications to the main domain in this particular example (not sure if this is relevant or not, but it is part of the generated URL so I thought I'd include it).
Obviously the addition of port ":80" to the URL is causing major issues. I've tried my best to see if this is something I can fix in the nginx rewrite / redirect rules and even manually adding port 443 as part of the rewrite rule for port 80 and it is still not working. The only change through all of this is upgrading from 4.0.59 to 5.0.1 with Passenger. I also tried using `callback_path` instead of `callback_url` in the omniauth strategy and that still strips the sub-URI from the URL and therefore is a no-go as well.
Did passenger break redirects in some form possibly, or perhaps I'm missing an option to tell passenger which port to request with a sub-uri app? The redirect rule is still working properly when hit over http, so I don't even think that the nginx rewrite should be relevant since this is from an application that's being hit directly from https in the URL to begin with and then passenger is sending to https + port 80...
If it's of any use, the rewrite rule for nginx originally looked like this:
server {
listen 80;
server_name domain.com;
rewrite ^ https://$server_name$request_uri?;
}