-
Notifications
You must be signed in to change notification settings - Fork 9
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
Use nginx for deployment #61
Comments
hmmm, not sure but I think this could be solved by adding cors to API from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["https://www.logdetective.com", "https://www.log-detective.com"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
) nginx deployment sauce: https://www.uvicorn.org/deployment/#running-behind-nginx https://docs.gunicorn.org/en/latest/deploy.html |
I know close to nothing about |
ah so cors won't help. I also found a way how to "merge" two certificates into one - maybe https://community.letsencrypt.org/t/host-multiple-domains-with-a-single-certificate/20917/4 will help? |
The wildcard certs work for subdomains of a single domain, basically It would be amazing if we could merge the certificates for log-detective and logdetective into a single certificate file. Also depends if gunicorn could work with such a certificate. |
|
tomas managed to merge those certificates \o/ #68 |
I think that longterm we'll need a proper web server between the openshift route and the application server (gunicorn) but for now, @nikromen is right that the problem is resolved |
The log-detective now redirects to https automatically, and logdetective redirects to log-detective.com. Only www.log-detective.com -> log-detective.com remains. |
I stored my WIP nginx configuration I had so once needed one can take a look and maybe copy something from nikromen@f75fd95 |
gunicorn works well but doesn't support 2 domains, which we have
Let's have an nginx in front of guni where we accept connections to both of the domains
Don't forget to create a route for logdetective.com too
The text was updated successfully, but these errors were encountered: