We present an exact solution of the nonlinear Schrödinger equation (NLSE) for beam propagation in nonlinear fiber optics. It is a lossy fiber system with the beam as solitons. Fiber losses are understood to reduce the peak power of solitons along the fiber length. That is due to its value depending on the fiber attenuation constant of α. Considering fiber loss features on the equation, we write one set modification of the NLSE and make models the main topic of our work. We solved the model and found a straightforward analytical solution of modified NLSE for the system via the direct solution method. To the best of our knowledge, no literature has presented such as solution yet. By substituting them into equations, we validate solutions. It is valid as an exact solution to the NLSE. Lastly, we found a solution offering soliton propagation suitable for the system under study.