When an environment variable needs to persist globally across the entire system, we can set it in the default profile loaded by all users on the system.
All global profile settings are stored under /etc/profile. And while this file can be edited directory, it is actually recommended to store global environment variables in a directory named /etc/profile.d, where you will find a list of files that are used to set environment variables for the entire system.
Create a new file under /etc/profile.d to store the global environment variable(s). The name of the should be contextual so others may understand its purpose.
sudo touch /etc/profile.d/http_proxy.sh
sudo gedit /etc/profile.d/http_proxy.sh
export YOUR_VAR_NAME=your_var_value