Parse recently open sourced a server implementation that you can run on your own server using node.js. I’ll show you how to use nginx as a proxy to the local instance of your own Parse Server as well as what configuration is needed to serve your “API” over a secure connection.

Prequesites
I assume you already have the open source server of Parse installed and set up, if not, clone the it fron their git repository which you can find here.

The vhost config for nginx

# /etc/nginx/sites-enabled/api.example.com
server {
       server_name api.example.com;
       #listen 443;

       #ssl_certificate /etc/letsencrypt/live/api.example.com/fullchain.pem;
       #ssl_certificate_key /etc/letsencrypt/live/api.example.com/privkey.pem;

       location / {
           proxy_pass http://127.0.0.1:1337;
           proxy_http_version 1.1;
           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection 'upgrade';
           proxy_set_header Host $host;
           proxy_cache_bypass $http_upgrade;
       }
}

It’s that simple, if you restart nginx now, it should act as a proxy to your Parse server and it should be available on http://api.example.com (replace example.com with your domain of course ;)). I highly encourage you to enable SSL as well, in the above example I used a certificate from Let’s Encrypt, the certificates are free and the setup is quick and painless. The actual path to the certificate will vary if you bought the certificate from a different company. In any case, simply remove the # and adjust the paths as needed, restart nginx and you should have the server up and running with SSL.