This paper proposes a new framework for reconfigurable intelligent surface (RIS)-equipped unmanned aerial vehicles (UAVs) in free-space optical (FSO) communication. To ensure practicality, we consider atmospheric loss caused by fog, which leads to an inhomogeneous medium for laser propagation. In addition, we incorporate the pointing error loss caused by the power fraction on the photodetector (PD) into the system and derive a closed-form expression for the elliptical beam footprint in the pointing error loss. We then propose a leading angle assisted particle swarm optimization (PSO) method to efficiently optimize the numerical results of pointing error loss. Furthermore, after obtaining these numerical results as a precondition, the UAV trajectory is optimized using the proximal policy optimization (PPO) method to achieve the maximum average capacity. Numerical simulations demonstrate that the proposed optimization method achieves greater efficiency and accuracy compared to the decode-and-forward (DF) relay and deep Q-learning (DQN) methods.