I have enabled google oauth2 provider in auth setting and configured it correctly. But when I click the button to start createOauth2Session with google I got the error message in google page as "redirect_uri_mismatch", and the detail information for developer is: require me to set up redirect_uri=http://api..., but I had configured the HTTPS redirect URI in google console for this oauth2 client ID. And My Appwrite console is also HTTPS and configured HTTPS endpoint in my app. Every step is correct, but I doubt that the createOauth2Session method used HTTP to initiate uri jumps. An important situation is that my Appwrite console uses nginx proxy to set up HTTPS. Is it related to this?
You need to make sure to proxy pass to Appwrite using https
Thanks Steven. But how to impl this process. My nginx proxy configures like this:
location / {
proxy_pass http://127.0.0.1:2023;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
add_header X-Cache $upstream_cache_status;
proxy_set_header X-Host $host:$server_port;
proxy_set_header X-Scheme $scheme;
proxy_connect_timeout 30s;
proxy_read_timeout 86400s;
proxy_send_timeout 30s;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
Proxy_pass https://127.0.0.1:<https port>
I had configured 2023 as 80, 2024 as 443 in docker-compose.yml file, but after I changed proxy pass to http://127.0.0.1:2024 , the console website become 404 page not found. π¦
services:
traefik:
image: traefik:2.7
container_name: appwrite-traefik
<<: *x-logging
command:
- --providers.file.directory=/storage/config
- --providers.file.watch=true
- --providers.docker=true
- --providers.docker.exposedByDefault=false
- --providers.docker.constraints=Label(`traefik.constraint-label-stack`,`appwrite`)
- --entrypoints.appwrite_web.address=:80
- --entrypoints.appwrite_websecure.address=:443
restart: unless-stopped
ports:
- 2023:80
- 2024:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- appwrite-config:/storage/config:ro
- appwrite-certificates:/storage/certificates:ro
depends_on:
- appwrite
networks:
- gateway
- appwrite
It should be https
Recommended threads
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...