Closed usmanarham closed 1 month ago
issue was with my nginx config solved that but now having issues of serving mixed content block
issue was with my nginx config solved that but now having issues of serving mixed content block
What do you mean by "mixed content block"?
This looks like #424
nginx config redirects every http call to https
`server { listen 80; listen [::]:80;
server_name domain.com;
# Redirect all HTTP traffic to HTTPS
if ($http_x_forwarded_proto != "https") {
return 301 https://$host$request_uri;
}
location / {
# Proxy pass to your application
proxy_pass http://127.0.0.1:8000/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Accept-Encoding gzip;
}
autoindex_localtime on;
}`
admin index page loads with all the static file but when it make call to listing api's using jquery it makes on http and gets blocked by browser
Access to XMLHttpRequest at '**http://**domain.com/admin/api/consumer?skip=0&limit=10&order_by=id%20asc' from origin '**https:**//domain.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
@usmanarham You should configure uvicorn / fastapi to respect x-forwarded-* options.
Option 1. There's a command-line key for that if you are running the app using uvicorn app. See here: https://www.uvicorn.org/deployment/#running-behind-nginx
Option 2. You can set ENV FORWARDED_ALLOW_IPS
to *
as the environment variable. Since we use Docker for running our apps, we've done it like this right in the Dockerfile that is used to build the app image.
The solution can be found here -> https://jowilf.github.io/starlette-admin/deployment/
Describe the bug i am following the custom MyAuthProvider for authentication and it works on localhost but when i deploy it on server and hit {server_url}/admin it shows https://{server_url}/admin/login?next=http%3A%2F%2F127.0.0.1%3A8000%2Fadmin%2F
which means its redirecting to localhost
here is my setup
the login form that shows up is posting on http://127.0.0.1:8000/admin/login instead of the server url, i am thinking there is some kind of setting for this issue can anyone guide me
Environment (please complete the following information):
Additional context Add any other context about the problem here.