In this case which modifies independence war of America.
Please note that there is an exception for the touch rule of relative pronoun modifier. The modifier can modify slightly far away noun if the context permits.
To be precise the context should have info which couldn't be placed anywhere in the sentence other than near the noun.
Eg:
I killed the snake, which lived in the burrow near my house.
Which refers to snake
I killed the snake with eggs, which lived in the burrow near my house.
Here, which refers to snake
I will kill the snake with eggs, which lay in the burrow near my house.
Here, meaning is ambiguous.
Which may refer to eggs or snake.
Press kudos if you find my answer useful
Posted from my mobile device