BANDA ACEH, Indonesia — Things were hopping at Redinesh Coffee Roastery in this seaside city one recent evening. Electronic dance music blared from the cafe’s speakers as patrons, some in ripped jeans and fashionable spectacles, sat outside drinking locally sourced coffee and smoking cigarettes.

But then the Muslim call to prayer sounded, and a waitress hurriedly ushered everyone back into the cafe. She turned down the music, closed the doors and covered the windows. It was the Maghrib — the second to last of the five daily calls to prayer — and outdoor socializing had to cease.

Aceh Province, on the northern tip of Sumatra island, stands alone in having formally established Shariah law in Indonesia, a Muslim-majority country with a relatively secular Constitution. In Aceh, women are required to dress modestly, alcohol is prohibited, and numerous offenses — from adultery to homosexuality to selling alcohol — are punishable by public whipping.