Support https and how to config?
Describe the bug By default, Pynecone runs in http mode. No related info found in Docs, how to set it up?
To Reproduce Steps to reproduce the behavior:
- Code/Link to Repo:
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Specifics (please complete the following information):
- Python Version:
- Reflex Version:
- OS:
- Browser (Optional):
Additional context Add any other context about the problem here.
https is supported by default. setting your api_url in rxconfig.py to an https url should work out of the box with no special configuration
I have no Nginx or something similar to setup cert or key, just only Reflex/Pynecone. Where should I put the cert and key files? I want both of frontend and backend are https enabled.
@evandeng2009 while i believe uvicorn and probably next itself support TLS certs, etc natively, reflex doesn't currently expose it.
If you're looking for something simple to terminate TLS, then I'd recommend taking a look at caddy with automatic HTTPS.
You can get started with a Caddyfile in your app directory like so:
localhost
reverse_proxy localhost:3000
reverse_proxy /event/ localhost:8000
(change localhost on the first line to whatever domain you own, and it will provision TLS via letsencrypt automatically for you)
Execute caddy run, then fire up https://localhost to see your reflex site.
Thank you @masenf , Caddy is a good tool for auto https. With reverse_proxy /event/ localhost:8000 and api_url=https://domain_only_without_specified_backend_port, users will see 80/http and 443/https only and this is what I want.
Caddy is more easy to use than other proxies like Ghostunnel as Caddy itself help get and renew the cert and key.