Report this

What is the reason for this report?

Possible to serve a single insecure file (apple-touch-icon) on nginx for a Meteor app?

Posted on February 23, 2015

I have a Meteor app setup following this basic procedure: https://www.digitalocean.com/community/tutorials/how-to-deploy-a-meteor-js-application-on-ubuntu-14-04-with-nginx

The one problem I am currently having is that, on iOS when I open the site in Safari and then choose to “Add to Home Screen”, Safari does not seem to find the “apple-touch-icon” and use this icon for the home screen. This works when the app is deployed to meteor.com and when run locally on my development machine.

There appear to be two primary differences from those and this deployment:

  1. On Digital Ocean nginx is sitting in front of the Meteor app.
  2. On Digital Ocean things are setup to run over SSL.

At first I thought it might be an issue of using the temporary/fake certificate as suggested in the tutorial above. However this problem persists even after installing a legitimate certificate.

So now my theory is that, for some reason, iOS Safari doesn’t like accessing the apple-touch-icon over HTTPS at all, so I want to try serving that icon over HTTP.

Is it possible to modify the configuration offered in that tutorial do try that?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I would first try redirecting http -> https

server { server_name xxx; return 301 https://$host$request_uri; }

If that doesn’t work you can serve the single file as needed:

server {
	server_name xxx;
	location = /apple-touch-icon.png { root /var/www/xxx/; }
	location / { return 444; }
}

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.