I had sewer flies in my house for 6 months. My problem seemed to center around the shower drain. For some reason I kept thinking they would go away on their own. I kept seeing a new crop of friends to say hi to in the moring before I showered. Finally I searched the internet for a solution. In the end I used feedback from multiple sources. Here is what I did.
1) I bought a zip it from Menards which is a stick with jagged edges that you insert in your shower drain to clear any pipe blockage. I ended up pulling a big wad of hair, 1 handful, which was the source where the flies were living and laying their eggs. The hair ball was approximately 10 inches into the drain. Since I had the drain cover already removed I used what I call a snake, plumbers rod to clear into the pipes much deeper say another 4 feet. Not much more hair came out so you may be safe with the 2 foot zip it.
2) I next poured bleach, approx 1/2 gallon into each drain in my home (shower, sink, toilet) to sit overnight. I made sure not to use our plumbing system that night to prevent washing out the bleach till next morning. I used 3 gallons of beach in total.
3) Next day I used my home normal. I did see a few fly survivors. After 2 weeks my home is fly free.