Skip to content

Commit 3247364

Browse files
committed
fix(docker): nest asset cache location inside /webapp/ to fix 404s
1 parent 3936633 commit 3247364

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,24 +109,25 @@ COPY <<EOF /etc/nginx/conf.d/default.conf
109109
server {
110110
listen 80;
111111
server_name localhost;
112+
root /usr/share/nginx/html;
112113

113114
# Serve the Admin SPA under /webapp/
114115
location /webapp/ {
115116
alias /usr/share/nginx/html/webapp/;
116117
try_files \$uri \$uri/ /webapp/index.html;
118+
119+
# Cache static assets
120+
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {
121+
expires 1y;
122+
add_header Cache-Control "public, immutable";
123+
}
117124
}
118125

119126
# Redirect /webapp to /webapp/
120127
location = /webapp {
121128
return 301 /webapp/;
122129
}
123130

124-
# Cache static assets
125-
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
126-
expires 1y;
127-
add_header Cache-Control "public, immutable";
128-
}
129-
130131
# Security headers
131132
add_header X-Frame-Options "SAMEORIGIN" always;
132133
add_header X-Content-Type-Options "nosniff" always;

0 commit comments

Comments
 (0)