A major wildfire is threatening communities in western Spain with more than 800 people evacuated.