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

Increase the thumbnail image size limit #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
20 changes: 10 additions & 10 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,25 @@ http {
proxy_cache_valid 200 1d;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;

if ($uri ~ "^/([1-9][0-9]{0,2})x/") {
if ($uri ~ "^/([1-9][0-9]{0,3})x/") {
set $width $1;
set $height -;
}

if ($uri ~ "^/x([1-9][0-9]{0,2})/") {
if ($uri ~ "^/x([1-9][0-9]{0,3})/") {
set $width -;
set $height $1;
}

if ($uri ~ "^/([1-9][0-9]{0,2})x([1-9][0-9]{0,2})/") {
if ($uri ~ "^/([1-9][0-9]{0,3})x([1-9][0-9]{0,3})/") {
set $width $1;
set $height $2;
}

# Proxy new panoptes-uploads-staging requests to Azure storage
# e.g. https://panoptes-uploads-staging.zooniverse.org/workflow_attached_image/704a79c1-e728-4ab3-828d-e398fba69ec3.jpeg
location ~ "^/[0-9]{0,3}x[0-9]{0,3}/panoptes-uploads-staging.zooniverse.org/.+$" {
rewrite "^/[0-9]{0,3}x[0-9]{0,3}/panoptes-uploads-staging.zooniverse.org(/.*)$" $1 break;
location ~ "^/[0-9]{0,4}x[0-9]{0,4}/panoptes-uploads-staging.zooniverse.org/.+$" {
rewrite "^/[0-9]{0,4}x[0-9]{0,4}/panoptes-uploads-staging.zooniverse.org(/.*)$" $1 break;
resolver 8.8.8.8;
proxy_pass https://panoptesuploadsstaging.blob.core.windows.net/public$uri?$query_string;
proxy_set_header Host panoptesuploadsstaging.blob.core.windows.net;
Expand All @@ -67,8 +67,8 @@ http {

# Proxy old panoptes-uploads staging requests to Azure storage
# e.g. https://panoptes-uploads.zooniverse.org/staging/workflow_attached_image/362d0a60-84a1-41db-9ea9-a42789f492c8.jpeg
location ~ "^/[0-9]{0,3}x[0-9]{0,3}/panoptes-uploads.zooniverse.org/staging/.+$" {
rewrite "^/[0-9]{0,3}x[0-9]{0,3}/panoptes-uploads.zooniverse.org/staging(/.*)$" $1 break;
location ~ "^/[0-9]{0,4}x[0-9]{0,4}/panoptes-uploads.zooniverse.org/staging/.+$" {
rewrite "^/[0-9]{0,4}x[0-9]{0,4}/panoptes-uploads.zooniverse.org/staging(/.*)$" $1 break;
resolver 8.8.8.8;
proxy_pass https://panoptesuploadsstaging.blob.core.windows.net/public$uri?$query_string;
proxy_set_header Host panoptesuploadsstaging.blob.core.windows.net;
Expand All @@ -79,8 +79,8 @@ http {
# Proxy panoptes-uploads production requests to Azure storage
# e.g. https://panoptes-uploads.zooniverse.org/production/workflow_attached_image/c3303c4d-28b2-453c-882c-63a95a5c41bc.jpeg
# https://panoptes-uploads.zooniverse.org/workflow_attached_image/6769554f-9079-41c8-acfc-393737a4972f.jpeg
location ~ "^/[0-9]{0,3}x[0-9]{0,3}/panoptes-uploads.zooniverse.org/.+$" {
rewrite "^/[0-9]{0,3}x[0-9]{0,3}/panoptes-uploads.zooniverse.org(?:/production)?(/.*)$" $1 break;
location ~ "^/[0-9]{0,4}x[0-9]{0,4}/panoptes-uploads.zooniverse.org/.+$" {
rewrite "^/[0-9]{0,4}x[0-9]{0,4}/panoptes-uploads.zooniverse.org(?:/production)?(/.*)$" $1 break;
resolver 8.8.8.8;
proxy_pass https://panoptesuploads.blob.core.windows.net/public$uri?$query_string;
proxy_set_header Host panoptesuploads.blob.core.windows.net;
Expand All @@ -90,7 +90,7 @@ http {

# proxy all other requests to the azure zoonversestatic storage account, $web container
location / {
rewrite "^/([0-9]{0,3}x[0-9]{0,3})(/.*)$" $2 break;
rewrite "^/([0-9]{0,4}x[0-9]{0,4})(/.*)$" $2 break;
resolver 8.8.8.8;
proxy_http_version 1.1;
proxy_pass https://zooniversestatic.z13.web.core.windows.net$uri?$query_string;
Expand Down