Skip to content

Commit

Permalink
Private files must take precedence before static files in nginx config,
Browse files Browse the repository at this point in the history
fixes #847 (#858)

* Move general file handling to after private files to fix backup_migrate, fixes #847

* Bump nginx-php-fpm-local version for pushed image

* Give a name to the nginx-php-fpm-local tag and push it
  • Loading branch information
rfay committed May 18, 2018
1 parent 2d3bab3 commit 0626755
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,6 @@ server {
expires 1h;
}

# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}

# Prevent clients from accessing hidden files (starting with a dot)
# This is particularly important if you store .htpasswd files in the site hierarchy
# Access to `/.well-known/` is allowed.
Expand All @@ -97,6 +90,13 @@ server {
try_files $uri @rewrite;
}

# Media: images, icons, video, audio, HTC
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}

## provide a health check endpoint
location /healthcheck {
access_log off;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ server {
}

# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}

# Prevent clients from accessing hidden files (starting with a dot)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ server {
}

# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}

# Prevent clients from accessing hidden files (starting with a dot)
Expand Down Expand Up @@ -101,6 +101,13 @@ server {
try_files $uri @rewrite;
}

# Media: images, icons, video, audio, HTC
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}

## provide a health check endpoint
location /healthcheck {
access_log off;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,6 @@ server {
expires 1h;
}

# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}

# Prevent clients from accessing hidden files (starting with a dot)
# This is particularly important if you store .htpasswd files in the site hierarchy
# Access to `/.well-known/` is allowed.
Expand All @@ -97,6 +90,13 @@ server {
try_files $uri @rewrite;
}

# Media: images, icons, video, audio, HTC
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}

## provide a health check endpoint
location /healthcheck {
access_log off;
Expand Down
2 changes: 1 addition & 1 deletion pkg/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var DockerComposeVersionConstraint = ">= 1.10.0-alpha1"
var WebImg = "drud/nginx-php-fpm-local"

// WebTag defines the default web image tag for drud dev
var WebTag = "v0.18.0-11-gd6cb228c" // Note that this can be overridden by make
var WebTag = "20180515_fix_backup_migrate" // Note that this can be overridden by make

// DBImg defines the default db image used for applications.
var DBImg = "drud/mariadb-local"
Expand Down

0 comments on commit 0626755

Please sign in to comment.