Having difficulties while deploying my project on Ubuntu server (probably nginx config or something)

Oh, so you are mixing them on the same host name. In this case you should configure strapi to be in a sub-folder. Take a look a the documentation I’ve shared, there is an example on how todo this. But I would also recommend to configure strapi on a subdomain and not on subfolder, like: api.mysite.com