Nicolas Winding Refn got the idea for the film while his wife was pregnant with their second daughter. He felt very existentialistic and felt he had much anger and violence in him, but did not know how to let it out. Suddenly he had the idea that the definite person to hold all the answers to existential questions and life's problems was God and imagined himself having a physical fight with God.
Production hit a snag when it became necessary to pay off the local authorities in order to get permission and protection to film at night, including firing gunshots, for certain scenes. Refn and star Ryan Gosling were invited to a film festival in Thailand. After some negotiating and taxes, they received 90,000 USD in cash for showing up. Refn recounts in his commentary how, having never seen that amount in cash in his entire life, he enjoyed counting it out himself. It was enough to bribe the necessary authorities, and production continued.
According to a Nicolas Winding Refn Q&A at Bam, the infamous insult "Cum Dumpster" was added into the movie after Refn (late one night) asked Ryan Gosling to come up with a list of the most vile words you could say to a woman. That word was at the top of his list.
Nicolas Winding Refn's approach to the movie changed when his daughter saw a ghost in her room in Thailand. He said that in the west, they'd have locked him up if he said there was a ghost, but in the Orient they called a shaman to make the spirit go away. He claimed that that experience made him realize that spirituality had another meaning in Asia, and that he wanted to make a movie with that kind of mysticism.
In his commentary, Nicolas Winding Refn states that Bangkok is a radically different city depending on the time of day. If it is daytime, it is, in his words, like Disney Land. By night, however, things are far more sinister.
Nicolas Winding Refn said that Gaspar Noé's work was an inspiration during the making of the movie. The latter was seen visiting the set during the shooting in Bangkok. He is also in the Special thanks of the credits.
The short sword that Chang wields seems to be a 'Kachin dha', from the Jingpho or Kachin people who inhabit the Kachin Hills in northern Burma's Kachin State, and neighboring areas of China and India. The name 'dha' is used for a wide variety of knives and swords used by many people across Myanmar (Burma), Thailand, Yunnan, Laos, Cambodia and Vietnam.
In terms of the musical inspiration for this film, Refn refers to how much of an influence the scores of Bernard Herrmann were. For the temp score that they edited the film to, they used Herrmann's score from The Day the Earth Stood Still (1951), which, Refn found out soon after, is composer Cliff Martinez's personal favorite.
The fight scene between Chang and Julian turned out differently in an earlier version of the script: Chang and Julian wore traditional clothes and before fighting they both performed a traditional dance, and at some point of the fight Julian was winning until Chang says "I forgive you" and ends up beating Julian.
The trivia items below may give away important plot points.
It was Ryan Gosling's idea to open the stomach of Julian's dead mother. He had it after director Nicolas Winding Refn asked him if he'd rather smile or cry after Julian's mom's death. He replied that he'd open her uterus to see what's inside.