Instead of a long list of my ancestors who served, I'd like to take this opportunity to encourage you to research the military service your ancestors. Any ancestors or collateral lines in my files that are of "age" to fight, I check for possible pension or service records. I also watch for military markers when I am photographing the headstones.
At one point you had to pay the National Archives an arm & a leg to obtain those pension files, but now days you can get them from Fold3. This isn't a commercial for them, I get no kickbacks. But I have found quite a bit of really good military information there. From Revolutionary War service & pension files to one or two things on some Viet Nam vets. I don't pay alot of attention to the personal pages, more interested in locating service & pension files.
For the civil war - especially on the Confederate side I've been very successful with the surgeon's reports, death & wound information and of course, service documents.
As with any paid site I really suggest that you keep very good records and read very carefully the terms of the trial useage before signing up. Once you do sign on for a trial I would make sure I followed the cancellation policy very carefully.
Groups like the Daughters of the American Revolution (DAR) have an ancestor file listing on their site, you could search to see if your ancestor has a listing there. A good place to look for military service information would be the census. According to the Census Bureau's page on Veterans the 1840 census was the first census to ask about military service. After that no military service questions appeared until 1910. 1920 had no military questions, but 1930 forward does have some military questions on the forms. You can read more about the inclusion of Military questions on the census here.
Ancestry.com also has military records on its site. As I stated before I do not work for Ancestry.com have no ties other than I do use the site periodically for my personal research. Trial memberships are good but beware of the cancellation policy and know what is expected of you if you decided to try that.
I guess the whole point is, you don't have to spend hundreds of dollars to research the military history of your ancestors. And personally, knowing that my ancestors served, and having it documented in my files is another important aspect of building & researching the family tree.