Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Redirect js.map , css.map

$
0
0
I am receiving multiple 404 errors for .map files which do not exist in my server logs. e.g.

/wp-includes/js/tinymce/skins/lightgray/skin.min.css.map
/wp-content/plugins/cornerstone/assets/dist/js/site/cs-head.js.map
/wp-content/plugins/cornerstone/assets/dist/js/site/cs-body.js.map

These files do not exist but I believe Chrome is asking for them when I am developing, hence the 404 errors in my logs.

How could I set up a redirect on Nginx so that files ending in css.map and js.map which do not exist, are redirected to a blank file called 404.map

In Apache I think this can be achieved as follows:

RewriteEngine On
Options +FollowSymlinks

# Prevent 404 Not Found for javascript/css source maps
RewriteCond %{REQUEST_URI} (\.map)$
RewriteRule (.*) 404.map [QSA]

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>