Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse proxy requests to api.parse.com allowing for early client migration? #137

Closed
codebreach opened this issue Feb 1, 2016 · 8 comments

Comments

@codebreach
Copy link
Contributor

This is an exploratory question in case someone here has already done this.

Is it possible to run nginx and rewrite api.mydomain.com to api.parse.com and push out new app versions with that?

This would become a Step 0 to the excellent migration guide, allowing for me to move my mobile clients to a domain I control before performing the Mongo migration and using this package to host my own backend?

Will api.parse.com and the (latest) clients SDKs be happy with that?

@blackxored
Copy link

I'm not sure about the SDKs but I would recommend setting up an API gateway for more flexibility.

@JcMinarro
Copy link

I have done it on my app and works fine

@natanrolnik
Copy link
Contributor

@JcMinarro could you provide some details of your implementation?

@codebreach
Copy link
Contributor Author

👍 would be super helpful to us and others if you can provide the config or some other info

@JcMinarro
Copy link

I have use nginx. Config is the next:

server {
    listen 80;
    listen [::]:80;

    root /var/www/[YOUR_DOMAIN_HERE]/html;
    index index.html index.htm;

    server_name [YOUR_DOMAIN_HERE] www.[YOUR_DOMAIN_HERE];

    access_log /var/log/nginx/[YOUR_DOMAIN_HERE].access.log cache;
    error_log /var/log/nginx/[YOUR_DOMAIN_HERE].error.log;

    location / {
        proxy_pass  https://api.parse.com/1/;
    }
}

@drew-gross
Copy link
Contributor

Thanks for the info @JcMinarro! This sounds like a great way to get a new version of you app out early so you can be ready to switch while you verify that your app still works with parse-server.

@blackxored
Copy link

@JcMinarro thanks for the info. You might want to set proxy headers such as originating IP and such as well.

@okwolf
Copy link

okwolf commented May 20, 2016

Sorry to be late to this party, but if you want your proxy new API URL to reflect your future parse-server URL for example https://api.example.com/parse you will need a config something more like this if using Nginx:

server {
  listen 443 ssl;
  ssl_certificate yourcert.crt;
  ssl_certificate_key yourkey.key;
  server_name api.example.com;

  location /parse {
    proxy_pass https://api.parse.com/1;
  }
}

I highly recommend using secure HTTPS communication. If you need a free cert, you can use Let's Encrypt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants