Rest API with custom Domain returns 404, but graphql and /admin works

System Information
  • Strapi Version: 3.4.6
  • Operating System: Ubuntu 18.04
  • Node Version: 12.8.13
  • NPM Version: 6.14.6
  • Yarn Version: 1.22.4

I’ve setup Strapi on DigitalOcean with a Droplet and a custom subdomain.
Everything works fine - admin, graphql, registration, SSL - except I get 404 when I try to access the Rest-API.

E.g.
https://api.domain.com/global → 404

I suspect it must be something with the proxy settings, but just can’t figure it out.
I’ve tried various configurations from the documentation, e.g.

https://strapi.io/documentation/developer-docs/latest/deployment/nginx-proxy.html#nginx-proxying

/config/server.js

module.exports = ({ env }) => ({
host: env('HOST', '0.0.0.0'),
port: env.int('PORT', 1337),
proxy: {
  enabled: true,
  host: 'api.domain.com',
  port: 443,
  ssl: true,
},
url: 'https://api.domain.com',
admin: {
auth: {
    secret: env('ADMIN_JWT_SECRET'),
   },
 },
});

/nginx/sites-available/strapi.conf

strapi.conf

upstream.conf

upstream strapi {
    server 127.0.0.1:1337;
}

Any idea what else I can check?

Update:

The problem is with the endpoints that I have created locally and uploaded manually.
Newly created endpoints work.

I need to migrate the database from local to live so that the endpoints work.

Ok stupid mistake.

I had in gitignore:
config/

The problem with that line is, it’s recursive and not only root folder.

So it ignored all the config files for the routes:
/api/xxx/config/*

Fixed by using the correct root-folder gitignore:
/config