Weird, the problem has developed a little bit. I eventually got it working on my domain, however as soon as I applied Let's Encrypt free SSL certificate the Cors error is back.
This is my server config:
server {
server_name growthpathways.co.uk www.growthpathways.co.uk;
location / {
proxy_pass http://localhost:3000; # Assuming your Next.js app runs on po>
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;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/growthpathways.co.uk/fullchain.pem; # >
ssl_certificate_key /etc/letsencrypt/live/growthpathways.co.uk/privkey.pem; >
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.growthpathways.co.uk) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = growthpathways.co.uk) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name growthpathways.co.uk www.growthpathways.co.uk;
return 404; # managed by Certbot
}
This is my error:
Access to XMLHttpRequest at 'https://cloud.appwrite.io/v1/account/sessions/email' from origin 'https://www.growthpathways.co.uk' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'https://localhost' that is not equal to the supplied origin.
Also works fine logging in from localhost, or from my servers IP address (I have 3 platforms set up on AppWrite for localhost, server IP, and domain)