cap_mkt_tools cap_mkt_tools - 1 year ago 72
iOS Question

IOS device cannot connect to nginx hosted meteor app on digitalocean

I have a meteor app which is hosted on digitalocean but my ios mobile app cannot connect to the server on digitalocean. There is no error but I am not able to login which is an indication that it cannot connect.

So, here is the setup and the steps I take to test. I do not list version numbers as I think that I am doing something conceptually incorrect.

On DigitalOcean I run nginx. Here is the config file in /etc/nginx:

map $http_upgrade $connection_upgrade {
default upgrade;
'' close;

server {
listen 80;

location / {
rewrite ^ https://$server_name$request_uri? permanent;

# HTTPS server
server {
listen 443 ssl;


ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;


location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; # allow websockets
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-For $remote_addr; # preserve client IP

Then, I run my meteor app with the following run script:

export NODE_PATH=/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript
export BIND_IP=
export PORT=3100
export MONGO_URL=mongodb://localhost:27017/pressit
export ROOT_URL=
export METEOR_SETTINGS='{ "somesetting": "someval", "public": { "othersetting": "anothervalue" } }'

cd /root/pressit/bundle
node /root/pressit/bundle/main.js > /root/log/pressit.log&

On DigitalOcean the Zone file is:

$TTL 1800 IN SOA 1473473851 10800 3600 604800 1800 1800 IN NS 1800 IN NS 1800 IN NS 1800 IN A

So, the web site works on

However, when I execute on my local development machine the following command the Simulator app cannot connect to the server machine (I tried them all).

meteor run ios --mobile-server
meteor run ios --mobile-server
meteor run ios --mobile-server
meteor run ios --mobile-server

When I run meteor locally and run the Simulator against localhost:3000 it works all fine.

One more comment is that my ssl setup does not use a commercial certificate and when I connect the first time to the browser warns of a non secure connection.

Any help would be very much appreciated.

Answer Source

This issue was caused by not having a SSL certificate by a CA. By connecting safari to the device for debugging the error message stated the SSL was the issue and with letsencrypt I created a new SSL and not it works fine.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download