Re: Gunicorn - HTTP and HTTPS in the same instance?

2022-01-10 Thread Lars Liedtke
server {    listen [::]:80;    listen 80;    server_name api.familie-liedtke.net;    location / {    return 301 https://$host$request_uri;    }    include /usr/local/etc/nginx/include/letsencrypt.conf; } server {    listen 443 ssl http2;    listen [::]:443 ssl http2;    server_name

Re: Gunicorn - HTTP and HTTPS in the same instance?

2022-01-10 Thread Lars Liedtke
I think this is more a thing of apporach. Nginx is quite simple to install and a config doing nothing else than redirecting https to https and proxying requests to a service (whichever tat is, in your case gunicorn) can become a nobrainer. That is what it became for me. Additionally the config

RE: Gunicorn - HTTP and HTTPS in the same instance?

2022-01-08 Thread Kirill Ratkin
Hi. You probably can solve issue on Gunicorn side. But afaik better solution is to use http proxy before Gunicorn. This proxy accepts https connection and proxy requests to Gunicorn instances as plain http. This approach gives you: a) Monitoring on network layer (tcpdump/wireshark shows you

Re: Gunicorn - HTTP and HTTPS in the same instance?

2022-01-08 Thread Skip Montanaro
Thanks all. I was hoping to get away without something more sophisticated like NGINX. This is just a piddly little archive of an old mailing list running on a single-core Ubuntu VM somewhere on the East Coast. Speed is not a real requirement. Load balancing seemed like overkill to me. Still, I

Re: Gunicorn - HTTP and HTTPS in the same instance?

2022-01-08 Thread Albert-Jan Roskam
I always use NGINX for this. Run Flask/Gunicorn on localhost:5000 and have NGINX rewrite https requests to localhost requests. In nginx.conf I automatically redirect every http request to https. Static files are served by NGINX, not by Gunicorn, which is faster. NGINX also allows you

Re: Gunicorn - HTTP and HTTPS in the same instance?

2022-01-07 Thread Kushal Kumaran
On Fri, Jan 07 2022 at 12:51:48 PM, Skip Montanaro wrote: > Hopefully some Pythonistas are also Gunicornistas. I've had little success > finding help with a small dilemma in the docs or in other more specific > sources. > > I'm testing out a new, small website. It is just Gunicorn+Flask. I'd