An error occurred (XAmzContentSHA256Mismatch) when calling the PutObject operation: The provided 'x-amz-content-sha256' header does not match what was computed.
'signature_version': 's3'
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
STORAGES = {
'default': {
'BACKEND': 'storages.backends.s3.S3Storage',
'OPTIONS': {
'access_key': os.getenv('AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('AWS_SECRET_ACCESS_KEY'),
'bucket_name': os.getenv('AWS_STORAGE_BUCKET_NAME'),
'endpoint_url': os.getenv('AWS_S3_ENDPOINT_URL'),
'signature_version': 's3'
},
},
'staticfiles': {
'BACKEND': 'storages.backends.s3.S3Storage',
'OPTIONS': {
'access_key': os.getenv('AWS_ACCESS_KEY_ID'),
'secret_key': os.getenv('AWS_SECRET_ACCESS_KEY'),
'bucket_name': os.getenv('AWS_STORAGE_BUCKET_NAME'),
'endpoint_url': os.getenv('AWS_S3_ENDPOINT_URL'),
'signature_version': 's3'
},
}
}
MEDIA_URL = f'{os.getenv('AWS_S3_ENDPOINT_URL')}/{os.getenv('AWS_STORAGE_BUCKET_NAME')}/media/'
STATIC_URL = f'{os.getenv('AWS_S3_ENDPOINT_URL')}/{os.getenv('AWS_STORAGE_BUCKET_NAME')}/static/'
server {
listen 80;
server_name example.com;
return 301 https://$server_name$request_uri; # enforce https
# rewrite ^(.*) https://www.example.com$uri permanent;
}
cd /usr/local/bin
# create symlink
ln -s /Applications/ngrok ngrok
ngrok -h
ngrok http 8080
~/.ngrok2/ngrok.ymlD
npm install ngrok -g
.....
var ngrok = require('ngrok'), //замена localtunnel, inspector => http://127.0.0.1:4040
.....
var config = {
server: {
baseDir: "./build"
},
//tunnel: true,
host: 'localhost',
port: 1984,
directoryListing: true,
logPrefix: ''
};
gulp.task('webserver', function () {
//browserSync(config);
browserSync(config, function (err, bs) {
ngrok.connect({
proto: 'http', // http|tcp|tls
addr: bs.options.get('port'), // port or network address
}, function (err, url) {
gutil.log('[ngrok]', ' => ', gutil.colors.magenta.underline(url));
});
});
});