Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions nginx.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ location /static/ {
if ($MAGE_MODE = "production") {
expires max;
}

# Remove signature of the static files that is used to overcome the browser cache
location ~ ^/static/version {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why limit to a location block and not always strip version ? Then the code would become:

rewrite ^/static/version\d*/(.*)$ /static/$2;

rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last;
}

location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
add_header Cache-Control "public";
add_header X-Frame-Options "SAMEORIGIN";
Expand Down