Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flask ssl certificates #116

Closed
dlcrista opened this issue Dec 12, 2018 · 5 comments
Closed

flask ssl certificates #116

dlcrista opened this issue Dec 12, 2018 · 5 comments

Comments

@dlcrista
Copy link

dlcrista commented Dec 12, 2018

Assuming that I'm using the file structure from example-flask-python3.7-index, how should I edit the nginx.conf file to accept an ssl certificate and a private key and serve flask over https?

@tiangolo
Copy link
Owner

tiangolo commented Jan 1, 2019

Sorry for the delay! I was busy building FastAPI.

The suggested way to have HTTPS is using Traefik, it can acquire free Let's Encrypt certificates (including renewals).

You can set up a Docker Swarm mode cluster with Traefik for HTTPS in about 20 min.

And then you can use one of the project generators that have everything set up to be integrated into the cluster. I just added information on that to the docs: https://github.com/tiangolo/uwsgi-nginx-flask-docker#project-generators

@dlcrista
Copy link
Author

dlcrista commented Jan 3, 2019

Thanks!

Btw, have this ever happened to you?

WARN received SIGTERM indicating exit request

and then uwsgi and nginx stops. I'm not sure what is sending the sigterm

@dlcrista dlcrista reopened this Jan 3, 2019
@tiangolo
Copy link
Owner

tiangolo commented Jan 3, 2019

Hmm, where do you see that? In the logs?

Are you sure Nginx stops too? Or is it only uwsgi?

@tiangolo
Copy link
Owner

tiangolo commented Feb 2, 2019

I just finished a big refactor to allow creating a file /app/nginx.conf. In it, you could add any custom configurations you need, including a custom TLS certificate.

The docs are here: https://github.com/tiangolo/uwsgi-nginx-flask-docker#overriding-nginx-configuration-completely


I still suggest you use Traefik for HTTPS, but in case you definitely need to customize it, there's the option now.

BTW, I created DockerSwarm.rocks to document how to set everything up.

@github-actions
Copy link

Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants