How do I build an WSGI apps built with CherryPyWSGIServer that support both HTTP and HTTPS?
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()
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.
Use a batch file to run your normal HTTP server on port 80 and a separate HTTPS instance on port 443.
Maybe this helps: http://docs.cherrypy.org/stable/refman/process/servers.html#multiple-servers-ports
精彩评论