Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Add Cache-Control header for static files in ASP nginx.conf #25

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
5 changes: 5 additions & 0 deletions config/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,21 @@ http {
# whether they exist or not. So quit right here, and allow direct access
# to common format files. Add formats here to allow direct link access
location ~ \.(gif|png|jpe?g|bmp|css|js|swf|wav|avi|mpg|ttf|woff)$ {
add_header Cache-Control "public, s-maxage=600, maxage=600";

# Show empty flag
location ~ (/ASP/frontend/images/maps)/.*\.(png|jpeg|jpg|gif)$ {
add_header Cache-Control "public, s-maxage=600, maxage=600";
try_files $uri $1/default.png =404;
}
# Show empty flag
location ~ (/ASP/frontend/images/ranks)/.*\.(png|jpeg|jpg|gif)$ {
add_header Cache-Control "public, s-maxage=600, maxage=600";
try_files $uri $1/rank_0.gif =404;
}
# Show empty flag
location ~ (/ASP/frontend/images/armies)/.*\.(png|jpeg|jpg|gif)$ {
add_header Cache-Control "public, s-maxage=600, maxage=600";
try_files $uri $1/small/-1.png =404;
}
try_files $uri =404;
Expand Down