Apache
Add the following line to either:
- the
.htaccess
in the directory serving your .pkpass, or
- to the
mime.types
file, or
- to your appache
httpd.conf
or virtuatl server .conf
file
Then restart Apache (not required if adding to .htaccess
)
AddType application/vnd.apple.pkpass pkpass
nginx
Add the following line to your mime.types
file and restart nginx
application/vnd.apple.pkpass pkpass;
IIS
- Open IIS Manager and navigate to the level you want to manage.
- In Features View, double-click MIME Types.
- In the Actions pane, click Add.
- In the Add MIME Type
.pkpass
- Type
application.vnd.pkpass
n the MIME text box
- Click OK
- Restart IIS
If you are serving your file via a script and are not able to edit your web server config you could add the following line before any content is sent:
PHP
header('Content-Type: application/vnd.apple.pkpass');
C#
WebClient client = new WebClient();
client.Headers.Add("Content-Type", "application/vnd.apple.pkpass");
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…