-
-
Notifications
You must be signed in to change notification settings - Fork 239
Closed
Description
My webpack configuration compiles a
.gzversion of the scripts, though only if the compression reduces the file size, meaning that some.jsscripts will have.js.gzcounterpart, some will not.I am able to tell nginx to try
.gzin case of.jsextension. Though, how'd I tell nginx to fallback to.jsif.js.gzdoes not exist?app.get('*.js', (req, res, next) => { // eslint-disable-next-line operator-assignment req.url = req.url + '.gz'; res.set('Content-Encoding', 'gzip'); next(); });To complicate things further, I am using serve-static.
In nginx I'd be able to achieve this using:
try_files $uri.gz $uri @404
Repost: http://stackoverflow.com/questions/42602053/how-to-try-a-file-and-fallback-to-another-file
Metadata
Metadata
Assignees
Labels
No labels