The accurate calculation of the two-phase relative permeability has a significant impact for effectively characterizing the fluid flow patterns of unsaturated shale reservoir. A new fractal relative permeability model is developed based on two-phase transport feature in confined nanopores, which is upscaled with the aid of fractal theory for two-phase flow through unsaturated shale porous medium. Unlike the earlier models, the presented models considered nanopore wettability, confined viscosity varies with the nanopore diameter (variable water phase viscosity), stress dependence effect, real gas effect, irreducible water saturation and tortuosity effect. The proposed model compares the permeability of single nanopore and multiple nanopores with earlier research, which shows that the fractal relative permeability model agrees well with earlier models and experimental data. The results show that the Monte Carlo model and Abaci experimental model studied by previous researchers are special cases of the proposed fractal model, thus showing that the proposed fractal model has obvious advantages. Further calculations show that 1) The gas phase’s relative permeability gradually decreases with the increase of water saturation; 2) Confined viscosity varies with the nanopore diameter has a greater influence on the inorganic pores and a smaller influence on the organic pores on the relative permeability; 3) The relative permeability of the intersection point in the organic pore is higher than that of the inorganic porous, but the water saturation at the intersection is less than that of inorganic pores. Therefore, it lays a solid foundation for revealing the two-phase flow law of shale porous media.