user16016486
user16016486

Reputation: 31

Set content type for apple-app-site-association file on nginx configuration

I am setting up the app clip functionality in my iOS app for which I have created an apple app site association file and placed it in the /.well-known/ directory.

I am setting the content-type as application/json as follows:

server {
   ...
   location /.well-known/apple-app-site-association {
      default_type application/json;
   }
}

I have also tried to set the content-type forcefully as follows:

server {
       ...
       location /.well-known/apple-app-site-association {
          types { } default_type "application/json; charset=utf-8";
       }
    }

However, when I curl it using command line, I get the content-type as text/html.

I am using the following curl command:

curl -v https://your_domain.com/apple-app-site-association

Please guide me with what is the correct way to set content-type for apple-app-site-association file on the nginx configuration.

Thanks!

Upvotes: 0

Views: 2758

Answers (2)

Darshil Shah
Darshil Shah

Reputation: 505

The content-type should be application/pkcs7-mime if you are trying to create deeplinks.

You need to have an entry in /etc/nginx/mime.types, something like

application/pkcs7-mime apple-app-site-association;

Upvotes: 0

pietrorea
pietrorea

Reputation: 898

This is the bit that I added to my server block for the AASA file:

location ~ "^/apple-app-site-association$" {
    default_type application/json;
}

Upvotes: 1

Related Questions