korolvs/thatsaboy

View on GitHub
docker/prod/static/upload.conf

Summary

Maintainability
Test Coverage
server {
    listen 80;
    server_name upload.kidsboards.local upload.kidsboards.org;
    root /data/photos;

    # process image cache
    location ~ ^/(?:\d+|-)x(?:\d+|-)/.*\.(?:jpg|jpeg|JPG|JPEG|gif|png)$ {
        alias   /tmp/nginx/img;

        # store image in cache
        proxy_store           /tmp/nginx/img;
        proxy_temp_path       /tmp/images;
        proxy_store_access    user:rw group:rw  all:r;
        proxy_set_header      Host    $host;
    }

    # CORS
    location ~ \.(js|css|png|jpg|jpeg|JPG|JPEG|gif|swf|ico|pdf|mov|fla|zip|rar|mp3)$ {
      add_header Access-Control-Allow-Origin *;
    }

    # security
    location ~ /\.(ht|svn|git|php|php3|phtml) {
      deny all;
    }

    access_log /home/app/logs/nginx-upload-access.log;
    error_log /home/app/logs/nginx-upload-error.log warn;
}