Skip to content

Commit a4c5be8

Browse files
committed
2 parents 65ba9da + 7a313ac commit a4c5be8

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,16 +219,32 @@ Add PDF.js assets to your `angular.json`:
219219

220220
#### Nginx Configuration
221221

222-
For production deployments using nginx, you may need to configure MIME types for PDF.js ES modules (`.mjs` files):
222+
For production deployments using nginx, configure MIME types for PDF.js ES modules:
223223

224224
```nginx
225225
# Add to your nginx.conf or site configuration
226226
types {
227227
application/javascript js mjs;
228+
text/plain ftl;
228229
}
229230
```
230231

231-
**Why this is needed**: PDF.js v5+ uses `.mjs` files (ES modules). Without proper MIME type configuration, nginx serves these files with incorrect content-type headers, causing the PDF viewer to crash during loading in production environments.
232+
#### IIS Configuration (Windows Server)
233+
234+
For production deployments using IIS, add to your `web.config`:
235+
236+
```xml
237+
<configuration>
238+
<system.webServer>
239+
<staticContent>
240+
<mimeMap fileExtension=".mjs" mimeType="application/javascript" />
241+
<mimeMap fileExtension=".ftl" mimeType="text/plain" />
242+
</staticContent>
243+
</system.webServer>
244+
</configuration>
245+
```
246+
247+
**Why this is needed**: PDF.js v5+ uses `.mjs` files (ES modules) and `.ftl` files (localization). Without proper MIME type configuration, web servers serve these files with incorrect content-type headers, causing the PDF viewer to crash during loading in production environments.
232248

233249
### Angular Version Support
234250

0 commit comments

Comments
 (0)