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 api.f
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
such proxy can do: simple authentication,
ddos/fail2ban and so on)
Quite often NGINX is better choice for such proxy. But apache is good as well.
Best regards.
Kirill
От: Skip Montanaro
Отправлено: 7 января 2022 г. в 21:54
Кому: Python
Тема: Gunicorn - HTTP and HTTPS in the same instance
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 gues
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
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 like
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 like
to both listen for HTTP and HTTPS connections. Accordingly, in my co