Timon and Pumbaa deliberately put themselves in danger to distract Scar's hyena Mooks in The Lion King just so Simba and Nala could pass by unseen. This example ends up subverting the usual trope, since Timon and Pumbaa actually manage to defeat the hyenas.
Attempted earlier in the mountain pass scene. Shang's troops, heavily outnumbered with almost no cannons, face the entire Hun army. They fully expect to be slaughtered, as the rest of the army was, and without Mulan using their last cannon to trap the troops in an avalanche, they would have.
Ray the firefly in The Princess and the Frog put up a great fight against the evil shadows sent by Facilier, to give Tiana enough time to run away with the talisman. Unfortunately, it wasn't enough to stop Facilier from stepping on him and killing him.
In How to Train Your Dragon this trope is subverted, after being invoked, quickly subverted, then re-invoked: Stoick and Gobber see the Green Death, and together with the whole adult Viking population have a Mass "Oh, Crap!" moment. After the big dragon decides to kick everybody's ass, Stoick runs in to buy time for the retreating army, mainly because wiping out all the parents in the population isn't too healthy. When Stoick tells Gobber why he's doing it, Gobber joins him, to double the time. Then, just before they go in, Hiccup and his friends arrive on dragons in a Big Damn Heroes moment.
In Shrek 2, Puss-in-Boots holds off a pack of guards as Shrek rushes to stop the Fairy Godmother's evil plot to make Fiona fall in love with her son, in payment of his debt to Shrek. He wasn't honestly in much danger from them, but that makes him holding them all off no less impressive, especially for a normal-sized housecat.
In The Movie of The Magic Roundabout, Zebedee apparently sacrifices himself to prevent Zeebad from going after the rest of the group, to the point of creating a landslide when they try to go back and help him.
All the more delicious of course because the voice of Zebedee is that of Ian McKellen, who delivered the Trope Namer.
Spoofed in Corpse Bride. The pastor stands at the doors of the church just before the climactic wedding, shouting at the Dead that they are not to enter the church. They merely file past him, admonishing him for shouting in a church. The fact that the character getting a You Shall Not Pass is played by Christopher Lee, who played Saruman the White in the Lord of the Rings films, makes the scene even more delicious for those who recognize Lee's ultra-distinctive voice.
Played straight in Predator, when Billy chooses to stop and wait for the alien hunter on a log bridge, throwing away his gun to fight with a big knife. Next thing we know, we're seeing through the Predator's eyes and he's creeping over the base of a fallen tree to confront Billy. Two seconds later the other survivors hear a horrible drawn-out scream. Then the Predator catches up with them again.
The movie 300 depicted a (very fanciful) version of the real life Battle of Thermopylae. In it, a handful of Greek soldiers successfully defend a narrow pass against a million-strong Persian army for three days before getting killed — and would have held out longer had they not been betrayed.
Not a sacrifice at all. Obi Wan smiles, turns off his lightsabre... and vanishes just before Vader's blade would have struck him, leaving his empty robe to fall to the floor. Vader is shown prodding the robe with his boot and clearly has no idea what Obi Wan just did.
The Mummy movie had Ardeth Bey literally wade into the undead hordes to give the heroes a chance to escape. Thanks to test audience reaction, he shows up at the end, mildly wounded. It happened a second time in the movie, or rather a first time, too: the museum curator (and secret Medjai agent) guy who held off the zombified population while the heroes escaped through the sewer. The second Mummy movie had Bey leading an entire army for the same purpose.
And after that, when the Alliance troops rush into the room, she is calmly and emotionlessly preparing to do it again. Considering the level of ass-kicking just demonstrated, it's a safe bet that the Alliance troops would have been massacred.
Monty Python and the Holy Grail actually has three examples, one with the Black Knight ("None shall pass!"), one with the wizard ("Answer me these questions three."). Arguably, the latter is actually more subversive. The other, of course, is the Knights of Ni.
The ending of X2: X-Men United is an example of this trope, with Jean Grey staying behind to hold off the inevitable just long enough for the rest of the team to escape. Although everyone, including her, thinks that No One Could Survive That, she manages to survive.
In Pirates of the Caribbean: At World's End, Commodore Norrington, instead of following Elizabeth on a rope off of the Flying Dutchman, chooses to cut it instead to guarantee her escape. He is then killed by Bootstrap Bill.
This trope was oddly subverted at the end of Pirates of the Caribbean: Dead Man's Chest, when Elizabeth handcuffs Jack to the mast of the Black Pearl in order to keep the Kraken from coming after the rest of the crew, since it only wants Jack. This, after Jack chose to come back and help the crew escape rather than abandon them as he almost did.
Yeah, but then they go get him back. And then they only did it because he was in possession of the missing Plot Coupon.
Embraced and subverted in Star Trek: First Contact. Picard clearly wants to sacrifice himself and his ship; "The line must be drawn HERE!" but in the end, compassion and common sense win out and he orders the crew to safety. In an earlier scene, one of the more amusing in the film, Doctor Crusher activates the Emergency Medical Hologram as the invading Borg are approaching Sick Bay and orders it to create a diversion. As the Borg break down the door, the nonplussed Doctor attempts to prescribe them an analgesic creme to soothe the skin rashes caused by their cybernetic implants.
"I'm a doctor, not a doorstop!"
Pulled off in Star Trek III. Kirk orders the destruction of the beloved Enterprise so that he and his crew can escape to Genesis while the explosion kills most of the enemy Klingons.
In the 2009 Star Trek, George Kirk of the Kelvin does this to the Narada to protect the evacuation shuttles.
Variation of this occurs too many times to list in Star Trek: Voyager. Janeway attempted to sacrifice Voyager on a number of occasions, and at least one version of Janeway succeeds. Dubbed a "variation" because she's also willing to claim "You Shall Not Pass" on behalf of the crew and ship, as well as herself.
The remake of Dawn of the Dead (2004). Arguable, but when C.J. remains in the truck at the end and then blows himself and all of the remaining zombies up. No, I don't know why they were all killed, but they were.
In The Matrix, Morpheus does this in order to buy time for Neo and the others to escape. While the remaining crew members later contemplate pulling his connection in order to prevent the Agents from gaining access codes to Zion, the last human city, Neo decides instead to rescue him, which he does in stunning awesomeness.
The Matrix Reloaded. Neo fights against the Merovingian's mooks so Trinity and Morpheus can escape with the Keymaker.
In The Matrix: Revolutions, hordes of the machines are storming Zion, one last elderly soldier stands bravely and alone, and blasts as many of them as he can before being mauled.
In The 13th Warrior, one of the 12 Norsemen stays behind in the tunnel to hold off the rampaging horde of cannibalistic cave-dwelling Neanderthals after uttering the tip-off phrase for a wounded soldier: "Well, I think I've gone as far as I can. Today was a GOOD day. Meet me in Valhalla!"
And speaking of Norsemen, the utterly forgettable Lee Majors movie The Norsemen sees this trope with a warrior named Olaf. Who later makes his way back from his sure-to-be-suicide stand. (The enemies that the Norse were fighting in this movie were native Americans who BTW were, according to the Vinland Saga, an enemy too tough for Vikings.)
Australia: The Drover's best friend against Japanese soldiers.
Starship Troopers. During the showdown in the Bug hive near the end of the movie, trooper Watkins is injured and can't escape.
Watkins: Give me the nuke! Rico:You trying to be a hero, Watkins? Watkins: I'm trying to kill some bugs, sir! (as the other MI escape, Watkins detonates the nuke, killing the Bugs)
Similar thing happened to Tom Sizemore's character in Red Planet.
Film/The. Katsumoto's wounded son Nobutada single-handedly holds off several Japanese soldiers at a small bridge behind his father's home in Tokyo, so that Katsumoto, Algren and the rest of the samurai can make their escape.
Gamera 2: Attack of the Legion. The SDF is evacuating Sendai when Legion attacks. Gamera arrives in time to hold the Legion off, but is mortally wounded while the SDF leaves.
The robot, remote-controlled by Will Robinson, in the movie version of Lost in Space.
The phrase gets spoofed in Forgetting Sarah Marshall. Peter went a whole week wearing the same pair of sweat pants. Come Saturday, he says "You Shall Not Pass".
Inverted in Inglourious Basterds; Pvt. Zoller is a war hero to the Nazis, for taking out a large number of American soldiers.
In Prince of Darkness, Catherine Danforth pushes Susan Cabot, who's been possessed by The Devil, into the mirror, to prevent her from pulling the Anti-God into our world. Unfortunately, she's also pulled into the mirror, which the priest then destroys, to seal the portal.
Subverted. After the giant cockroach alien kills two other aliens in a cafe and smashes the place up, a brave waiter blocks the doorway and says, "You're not going anywhere, pal!" only to get knocked into next week.
And again in the climax, where J brandishes a burning branch and warns that the only way off the planet was through him. The Cockroach then promptly decks J to the ground and continues to head for his getaway saucer, evdiently having a very low tolerance for chutzpah.
Terminator 2: Judgment Day. Sarah Connor tricks John into getting onto the sliding track so he's taken to safety, then stays behind to prevent the T-1000 from following and killing him.
Frankie in Daybreakers redeems himself by holding back his former comrades so that the hero and heroine could get away. Needless to say, he doesn't survive.
A villainous example occurs in Pacific Rim where Slattern nearly succeeded in preventing the heroes in reaching the Breach.
This is actually the main strategy of the Pan Pacific Defense Corps. If a Kaiju is heading towards a city, they place a Jaeger a short distance away from the city, directly in the Kaiju's path.
October, a 1928 Soviet Union film about the Red October revolution, includes the abortive coup attempt by monarchist General Kornilov. The workers of Petrograd arm for battle, pledging that "Kornilov shall not pass!".