<!--
	d36cz9buwru1tt.cloudfront.net
	s3.amazonaws.com/awsmedia/
	s3.amazonaws.com/rodica-work/

-->
<ruleset name="Amazon Web Services">

	<target host="aws.amazon.com" />
	<target host="signin.aws.amazon.com" />
	<target host="aws-portal.amazon.com" />
	<target host="images.amazon.com" />
	<target host="payments.amazon.com" />
	<target host="rcm-images.amazon.com" />
	<target host="sis.amazon.com" />
	<target host="ws.amazon.com" />
	<target host="s3.amazonaws.com" />
	<target host="*.s3.amazonaws.com" />
		<!--
			Bloody forced redirection:

			https://mail1.eff.org/pipermail/https-everywhere-rules/2012-April/001100.html
      https://trac.torproject.org/projects/tor/ticket/4199 
											-->
		<exclusion pattern="^http://(?:static\.via\.me|img\.wired\.co\.uk|s3\.sandbaguk\.com|spiegeltv-ivms2-restapi|spiegeltv-prod-static|www-prod-storage\.cloud\.caltech\.edu)\.s3\.amazonaws\.com/" />
		<!--
			Breaks soundsjustlike.com audio:
							-->
		<exclusion pattern="^http://badracket-website\.s3\.amazonaws\.com/swf/soundmanager\d_flash\d\.swf" />
		<!--
			https://trac.torproject.org/projects/tor/ticket/7857

			Breaks images:
					-->
		<exclusion pattern="^http://em\.css\.s3\.amazonaws\.com/style\.css" />
    <!--  This one looks slightly different
    https://trac.torproject.org/projects/tor/ticket/7608 
    -->
		<exclusion pattern="^http://charts-datawrapper\.s3\.amazonaws\.com/" />
		<exclusion pattern="^http://soundcloud-upload\.s3\.amazonaws\.com/" />

	<target host="cdn.*.s3.amazonaws.com" />
	<target host="s3-eu-west-1.amazonaws.com" />
	<target host="*.s3-eu-west-1.amazonaws.com" />
	<target host="cdn.*.s3-eu-west-1.amazonaws.com" />
	<target host="*.images-amazon.com" />
  <!-- Zeitgeist MP3 player https://trac.torproject.org/projects/tor/ticket/7594 -->
  <exclusion pattern="^http://g-ecx\.images-amazon\.com/.*([mM][pP]3|zeitgeist|digital/music)" />
  <!-- https://trac.torproject.org/projects/tor/ticket/7539 -->
  <exclusion pattern="^http://ecx\.images-amazon\.com/" />
  <exclusion pattern="^http://ecx\.images-amazon\.com/" />
	<target host="amazonwebservices.com" />
	<target host="*.amazonwebservices.com" />

	<rule from="^http://(signin\.aws|aws(-portal)?|payments|sis|ws)\.amazon\.com/"
		to="https://$1.amazon.com/" />

	<rule from="^http://s3(-eu-west-1)?\.amazonaws\.com/"
		to="https://s3$1.amazonaws.com/" />

	<rule from="^http://([^@:\.]+)\.s3(-eu-west-1)?\.amazonaws\.com/"
		to="https://$1.s3$2.amazonaws.com/" />

	<rule from="^http://([^@:\.]+)\.([^@:/]+)\.s3(-eu-west-1)?\.amazonaws\.com/"
		to="https://s3$3.amazonaws.com/$1.$2/" />

	<rule from="^http://(?:www\.)?amazonwebservices\.com/"
		to="https://aws.amazon.com/" />

	<rule from="^http://developer\.amazonwebservices\.com/"
		to="https://developer.amazonwebservices.com/" />

	<rule from="^http://media\.amazonwebservices\.com/"
		to="https://s3.amazonaws.com/awsmedia/" />

	<rule from="^http://(?:(?:\w-)?ec[2x]\.images-|(?:rcm-)?images\.)amazon\.com/"
		to="https://images-na.ssl-images-amazon.com/" />

  <!-- Exclusions for Amazon's Zeitgeist MP3 Player
       https://trac.torproject.org/projects/tor/ticket/7000 
       note that the second exclusion can't be scoped to the ssl-images-amazon
       domain, though it could have copied the crazy pattern from the rule
       above -->
  <exclusion pattern="^http://amazon-zg\.s3\.amazonaws.com/" />
  <exclusion pattern="^http://[^@:/]+images[^@:/]+/images/G/01/zeitgeist/mp3player" />

</ruleset>
