Beau Simensen
Beau Simensen

Reputation: 4578

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()

Upvotes: 2

Views: 479

Answers (2)

Cees Timmerman
Cees Timmerman

Reputation: 19644

Use a batch file to run your normal HTTP server on port 80 and a separate HTTPS instance on port 443.

Upvotes: 0

John La Rooy
John La Rooy

Reputation: 304137

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.

Upvotes: 2

Related Questions