The way W. Somerset Maugham (1933) tells
the tale, it is set in Baghdad/Samarra.
The way Viktor Frankl (1946) tells
the tale (next to last paragraph), it is set in Teheran. (The spelling of Tehran as Teheran is probably an artifact of translation from the German.)
Now I want to know which version (if any) is the correct historically traditional