Python SimpleHTTPServer in production

I want to use static files with Python. Is Python 3 http.server suitable for use in production? If not, why not? And what are my alternatives?

+8
source share
1 answer

Documentation citation https://docs.python.org/3/library/http.server.html#module-http.server

Warning: http.server is not recommended for production. It implements only basic security checks.

First of all, you don’t need python at all for serving static files. Just use a real HTTP server like Apache or NGinx. If you want a quick solution, just find a dock container with a pre-configured image suitable for your needs. This is NGinx . Definitely a docker is an indispensable tool that you will not regret to study.

 $ docker run --name mysite-nginx -v /mysite:/usr/share/nginx/html:ro -p 80:80 -d nginx 
0
source

All Articles