AWS_ACCESS_KEY_ID = ''
AWS_SECRET_ACCESS_KEY = ''
AWS_STORAGE_BUCKET_NAME = 'diasmart-media-static'
S3_REGION = 'eu-north-1'
AWS_S3_SIGNATURE_VERSION = 's3v4'
AWS_S3_FILE_OVERWRITE = False
AWS_DEFAULT_ACL = None
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
# Static and media
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'assets')
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static')
]
MEDIA_URL = f'https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/'
location /media {
resolver 8.8.8.8;
set $aws_bucket "diasmart-media-static";
set $aws_endpoint "diasmart-media-static.s3.amazonaws.com";
set $aws_custom_secret "";
proxy_set_header User-Agent $aws_custom_secret;
rewrite ^/media/(.*)$ /$1 break;
proxy_buffering off;
proxy_pass https://$aws_endpoint;
}