Hello, I am building an application that consists of two areas; a website and an API. I would like the website to use HTTP and the API to use HTTPS. How can I set this up for my Development Environment? I am using Thin, which I can start using the --SSL flag. However this means any HTTP urls will fail. As far as I can see it is impossible to have a server handle both HTTP and HTTPS, so how do people develop an application that uses SSL locally? Thanks. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Wed, Apr 4, 2012 at 9:46 AM, Pedr Browne <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I am building an application that consists of two areas; a website and > an API. I would like the website to use HTTP and the API to use HTTPS. > How can I set this up for my Development Environment? > > I am using Thin, which I can start using the --SSL flag. However this > means any HTTP urls will fail. As far as I can see it is impossible to > have a server handle both HTTP and HTTPS, so how do people develop an > application that uses SSL locally?Why not just do what you would do in production: put an SSL-capable proxy (apache httpd, nginx, squid, etc.) in front of thin? Alternatively, start 2 instances of thin on appropriate ports. HTH, -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hassan, Thanks for your reply. Would you mind elaborating on the these option? This is new ground for me. I haven''t used SSL before and I''ve never set up a production server. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Thu, Apr 5, 2012 at 1:25 AM, Pedr Browne <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Would you mind elaborating on the these option? This is new ground for > me. I haven''t used SSL before and I''ve never set up a production > server.It''s common to use a web server like Apache httpd that can listen on multiple ports, e.g. both 80 (http) and 443 (https) and proxy requests to a back-end Rails server like thin, mongrel, unicorn. It''s not hard to configure and there are plenty of tutorials, I''m sure. (You can also use nginx, squid, or some other proxy.) And some people use Passenger (mod_rails) which gives you an integrated Rails server with Apache httpd or nginx, eliminating the backend/proxy part. Less flexible but fewer moving parts... Either approach will work in production, so I''d look into both and see what feels best to you. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks Hassan. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.