當服務與Django的存儲介質S3,正在生成媒體的URL是這樣的:Django的S3存儲介質網址爲https://,而不是http://
https://mybucket.s3.amazonaws.com/myimage.jpg?Signature=5ifoyLqzmtfVNS1ovfzVvN92RH0%3D&Expires=1363124819&AWSAccessKeyId=AKIAJ7ZTU7K4SPYKGOFA
導致圖像因爲HTTPS的不被顯示:
You attempted to reach mybucket.s3.amazonaws.com,
but instead you actually reached a server identifying itself as *.s3.amazonaws.com.
This may be caused by a misconfiguration on the server or by something more serious. An attacker on your network could be trying to get you to visit a fake (and potentially harmful) version of mybucket.s3.amazonaws.com.
我需要的圖像用以作爲HTTP不是HTTPS
我的設置是:
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
AWS_ACCESS_KEY_ID = "AKIAJ....K4SPYKGOFA"
AWS_SECRET_ACCESS_KEY = "2Y7G98JoCRzAEp....rPoCjWZuwDaQ"
AWS_STORAGE_BUCKET_NAME = "mybucket"
我試着將media_url和s3_url設置爲正常的http,但它沒有改變任何東西。
我使用Django 1.5
你能告訴我在AWS控制檯的哪個位置我會做出這樣的改變嗎? – 2015-09-25 01:14:47
您應該在Django設置文件中進行更改(默認爲settings.py) – YardenST 2015-09-25 05:25:44
感謝您回覆我。恐怕我問的是錯誤的問題。我只是使用S3作爲保存我下載到iOS應用程序中的文件的地方。我以前使用過http,但現在失敗了,顯然亞馬遜改爲使用https。我的應用程序已部署,我試圖讓AWS返回到響應http。我不認爲我使用Django,但這篇文章似乎在談論同樣的事情。如果你有任何指向我的想法,我將不勝感激! – 2015-09-25 15:48:20