You are correctly.
Why does one server add the \r but not the other.
I do the same on both server, using nano to create a file.
When I do test again, I am not able to reproduce the problem.
It's possible to create a \r inside nano with the right key sequence but I can't remember what it is. I can't find any commandline switch or nano option which forces dos-mode though.
What is OS ?
MAC ==> end line is \r
DOS ==> end line is \r\n
Unix ==> end line is \n
Maybe, when you edit your file with problem, the file already exist and this content was just one byte ==> \r
And if force convert unix mode is not enable in nano...