CSS blocked:mixed-content for gunicorn server | HTTPS | FastAPI | Serving HTML
project id:
22ce14b2-4953-42e3-aed4-b106fa5da66e/service/c5ee3e3a-1864-440a-bd31-c67e7acf0494?id=e9b90c2c-08f4-4a71-a49d-841e02ec614e
Stack: Python FastAPI server that serves HTML+CSS
Issue: I see a page with no css applied and a network tab that indicates it was blocked due to "mixed-content"
Expected outcome: I see the page with css applied
Relevant Links:
https://github.com/tiangolo/fastapi/issues/2611
https://www.uvicorn.org/deployment/#running-with-https
Possible Solution:
Do I have access to the ssl keyfile? If so, I can just specify it in the commandline.GitHub
Failure to load any static files when deploying with HTTPS · Issue ...
Code <head> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet"> <link href="{{ url_for('stat...
Deployment - Uvicorn
The lightning-fast ASGI server.
9 Replies
Project ID:
22ce14b2-4953-42e3-aed4-b106fa5da66e,c5ee3e3a-1864-440a-bd31-c67e7acf0494,e9b90c2c-08f4-4a71-a49d-841e02ec614e
You might find these helpful:
- disabling ssl/http option?
⚠️ experimental feature
can you send your apps domain?
this doesnt have anything to do with anything you linked
youre trying to access your css over http, just change the href to use relative paths
this
<link rel="stylesheet" href="http://news-aggregator-production.up.railway.app/static/output.css" />
becomes
<link rel="stylesheet" href="./static/output.css" />
it's amazing how dumb I am sometimes
i swear a write code for a living
doubt
:(
haha no worries, we all make mistakes