Hey all, I'm having some issues getting the payload server deployed. I have managed to deploy the CMS front end to our basic linux web host. But for some reason, I can't get the API to work at all. I've also tried deploying to Azure web services. That threw out a lot of cors errors which I fixed inside azure but the cors errors still remain.
I've followed through the payload docs but can't seem to make any sense of the deployment process.
When deploying, is there any certain folders that the files need to be placed in? Is there any other config I might be missing?
I am just deploying the build and server files manually via FTP so could very well be missing something.
Can someone help?
In order to deploy Payload, you'll need both the dist and build directory after building.
I can't get the API to work at all
Providing more detail here would give more info in order to help. Are you able to hit the API at all? Receiving 5XX/4XX errors? Can you provide the cors errors? Do you have the
property set in your config?
Hey Elliot, I managed to get it working on Friday. I had some ports all wrong which was causing the errors.
@mrl7 Great to hear!
Hello, can u give more detail about deploying payloadCMS using nginx . Im trying to deploy payloadCMS in ubuntu+nginx. I have moved build files to my nginx so i can access my index.html from browser. But its receiving error 404 when requesting js and css file. If i look into index.html, js and css files is located in admin folder, but i dont see them in my build files.
sorry I'm just learning how to deploy using nginx
Have a look at the config in this thread. There might be some ideas there:https://payloadcms.com/community-help/github/req-and-user-are-undefined-running-behind-nginx-proxy
Thanks a lot
Hi! I'm deploying in the exact same way, nginx reverse proxy that points to the node server that runs locally (EC2 instance, not my machine) on port 3000. However, my issue is a bit different - when i go to mysite.com its successfull but im stuck in an infite loading loop. Looking in the console i get error:
Which is strange, cause the payload config has
set and my initial request is successfull and my browser is downloading the js files and hydrating etc etc. So I don't understand why it's trying to communicate with the api like its running on localhost instead of mysite.com?
Any help would be greatly appreciated!
EDIT: Apparently setting cors to "*" solved it. Not sure why whitelisting my own domain doesn't work tho.