Skip to content

Commit 8ec9a3a

Browse files
committed
Update static block in nginx.conf
Update the 'nginx.conf.sample' to allow the browsers for accessing the static contents even in multisite mode also.
1 parent b46b8be commit 8ec9a3a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

nginx.conf.sample

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,16 @@ location /static/ {
9999

100100
# Remove signature of the static files that is used to overcome the browser cache
101101
location ~ ^/static/version {
102-
rewrite ^/static/(version[^/]+/)?(.*)$ /static/$2 last;
102+
rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last;
103103
}
104104

105-
location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|json)$ {
105+
location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
106106
add_header Cache-Control "public";
107107
add_header X-Frame-Options "SAMEORIGIN";
108108
expires +1y;
109109

110110
if (!-f $request_filename) {
111-
rewrite ^/static/?(.*)$ /static.php?resource=$1 last;
111+
rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
112112
}
113113
}
114114
location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
@@ -117,11 +117,11 @@ location /static/ {
117117
expires off;
118118

119119
if (!-f $request_filename) {
120-
rewrite ^/static/?(.*)$ /static.php?resource=$1 last;
120+
rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
121121
}
122122
}
123123
if (!-f $request_filename) {
124-
rewrite ^/static/?(.*)$ /static.php?resource=$1 last;
124+
rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
125125
}
126126
add_header X-Frame-Options "SAMEORIGIN";
127127
}

0 commit comments

Comments
 (0)