views:

64

answers:

1

I built a WSGI app and created a standalone wrapper using CherryPyWSGIServer. I see that CherryPyWSGIServer supports HTTPS but I am not sure how to support both HTTP and HTTPS together as it looks like the first server.start() blocks. How would I create two servers, one HTTP and one HTTPS, and start them both?

Here is what I have now:

server = CherryPyWSGIServer( (http_ip, http_port),  web_app )
try:
    server.start()
except KeyboardInterrupt:
    server.stop()
+1  A: 

Whenever I have done this in the past, I have used Apache or Nginx in front of the webserver, and let those handle the https.

gnibbler
I was hoping to avoid any other dependencies but resorting to using another webserver is definitely a backup if I cannot find a relatively easy to implement Python solution.
Beau Simensen
I would recommend nginx, regardless. You may not need it now, but it's so handy to have in place if you suddenly need to do some sort of filtering or load balancing etc.
gnibbler