From The Art and Popular Culture Encyclopedia
The term was then used to name the prison for hostages in Istanbul, which was near the bath-house, and thereafter all the slave prisons in the Ottoman Empire and the Barbary regencies. In the Barbary prisons, the hostages of the pirates spent their nights there, leaving during the day to work as laborers, galley slaves, or domestic servants. Bagne became the French word for the prisons of the galley slaves in the French Navy. The last one in European France (Toulon) was closed in 1873. The communication between master and slave and between slaves of different origins was made in Lingua Franca (also known as Sabir), a Mediterranean pidgin with Romance and Arabic lexicon.
In England, it was originally used to name coffee houses which offered Turkish baths, but by 1740 it signified a place where rooms could be hired with no questions asked, later a house of prostitution.
Los tratos de Argel ("The trades of Algiers", 1580), Los baños de Argel ("The Bagnios of Algiers", 1615), El gallardo español ("The Gallard Spaniard", 1615) and La gran sultana ("The great sultaness", 1615) were four comedies by Miguel de Cervantes about the life of the caitiffs. Cervantes himself had been imprisoned in Algiers (1575-1580). His Don Quixote also features a subplot with the story of a caitiff (chapters 39-41 of the first part). In The Day of the Locust, (Nathanael West, 1939), Claude Estee's wife, Alice, says "Nothing like a good bagnio to set a fellow up." A bagnio, in reference to a brothel or boarding house, is also mentioned in The Private Memoirs and Confessions of a Justified Sinner by James Hogg as the location of a quarrel between two young Edinburgh nobleman that precedes one of them being murdered and the other arrested for the crime.