Sounds like a leak or a burst hose or pipe. Modern braking systems have a safety feature that lets you use some brakes even if a hose burst, so that would explain why only the front brakes seems to take. (https://en.wikipedia.org/wiki/Hydraulic_brake#Component_specifics)
the FMVSS Standard 105, 1976; requires the master cylinder is divided internally into two sections, each of which pressurizes a separate hydraulic circuit. Each section supplies pressure to one circuit. The combination is known as a dual master cylinder. Passenger vehicles typically have either a front/rear split brake system or a diagonal split brake system.
What you should do is get under the car and see if you can locate any leaks, start right by the wheels and follow the lines from there. I would bet its a hose or a rusty pipe that is your culprit. Since fluid is disappearing you should be able to find where it goes. Refill your brake system and ask a friend to push the brakes while you investigate if you cannot see right away.
It seems like at least some pathfinders have drum brakes as well, if your car has, it could be that the wheel cylinder leaks and lowers the friction of the brake shoes (which can make it seem like you have no brakes at all). This should be on only one side of the car though as long as there is fluid left.
As for cost you can probably get a hose for 10$, but replacing a brake line is more work and not as cheap. If there's a problem with wheel or master cylinder, more work is involved as well.
You should definitely look into this problem ASAP, you are driving without brake system redundancy and if a front wheel hose breaks as well you will be riding only with your handbrake.
Also please note that the brake fluid is wery unhealthy both for you and your environment, so be careful with it.