Chapter 3. Customizing the Red Hat Lightspeed proxy
With Red Hat Lightspeed proxy, you can designate additional dnf or yum servers, customize the rhproxy configuration, and use customized commands and configuration options.
3.1. Designating optional dnf and yum servers Copy linkLink copied to clipboard!
To add additional third-party servers, including non-Red Hat and non-EPEL servers, create a custom allowlist for rhproxy.
Save the hostnames of systems providing dnf repositories in the following file:
/home/rhproxy/.config/rhproxy/env/mirror.servers-
Open the
/home/rhproxy/.config/rhproxy/env/mirror.serversfile, and add the hostnames of any systems that provide dnf repositories. After adding your systems, restart the service:
[rhproxy@server ~]$ rhproxy restart
-
Open the
Verification step
Run the following command to ensure that your third-party services were added:
[root@server ~]# curl -x http://$(hostname):3128 https://<hostname>
3.2. Customizing the rhproxy configuration Copy linkLink copied to clipboard!
You can further customize your rhproxy configuration. For a list of configurable options and their descriptions, see Appendix A.
Prerequisites
- You have at least one active Red Hat Enterprise Linux (RHEL) subscription.
- For the Red Hat Lightspeed proxy installation, you have at least one system running RHEL version 9.
- You are logged in to the system as root or have sudo permissions.
- Your architectural environment is Intel or ARM.
-
You are logged in as the
rhproxyuser.
Procedure
- Log in to the Red Hat Lightspeed proxy server.
-
Edit the
/home/rhproxy/.config/rhproxy/env/rhproxy.envfile and make changes to the default configuration. Run the following command to restart the Red Hat Lightspeed proxy and enable your configuration edits to take effect:
[rhpproxy@server ~]$ rhproxy restartThe allowed upstream servers are listed in the following files:
Red Hat servers are listed in:
/home/rhproxy/.config/rhproxy/env/redhat.servers- The DNF or YUM EPEL servers are listed in:
/home/rhproxy/.config/rhproxy/env/epel.servers
The preceding files get overwritten with rhproxy RPM updates. When the files are overwritten, you must reapply the manual configuration updates that you make.
3.3. Unconfiguring client systems when you want to disable the Red Hat Lightspeed proxy Copy linkLink copied to clipboard!
You might decide to stop using the Red Hat Lightspeed proxy. Use the following procedure to unconfigure your client systems so that they no longer go through the Red Hat Lightspeed proxy.
Prerequisites
- You have at least one active Red Hat Enterprise Linux (RHEL) subscription.
- You have at least one system running RHEL version 9, for the Red Hat Lightspeed proxy installation.
- You are logged in to the system as root or have sudo permissions.
- Your architectural environment is either Intel or ARM.
Procedure
- Open your command-line interface, and navigate to the specific client system you want to remove from the Red Hat Lightspeed proxy.
Run the following command on your client system:
[root@client ~] ./configure-client.sh --unconfigureVerification step
If the procedure is successful, you will see the following output:
Un-configuring insights-client/rhsm/rhc/rhcd from proxying to Red Hat Lightspeed
3.4. Appendix A: Command options for the Red Hat Lightspeed proxy Copy linkLink copied to clipboard!
You can use the following options with the rhproxy command:
| Option | Description |
|---|---|
| install | Installs the Red Hat Lightspeed proxy. |
| uninstall [-f] |
Uninstalls the Red Hat Lightspeed proxy. Specify |
| start | Starts the Red Hat Lightspeed proxy. |
| stop | Stops the Red Hat Lightspeed proxy. |
| restart | Restarts the Red Hat Lightspeed proxy. |
| status | Displays the status of the proxy’s running service and connection logs. |
| update | If you change the default 3128 port, you will need to use this option to update the configure-client.sh script. |
3.5. Appendix B: Configuration options for the Red Hat Lightspeed proxy Copy linkLink copied to clipboard!
If you want to run your proxy with non-default parameters, see the following table for a list of available options that you can set in the /home/rhproxy/.config/rhproxy/env/rhproxy.env configuration file.
| Option | Description |
|---|---|
| RHPROXY_DISABLE | This option will disable an active proxy. This defaults to 0. |
| RHPROXY_DEBUG_CONFIG | Use this option to log environment variables and Nginx configuration upon startup. This defaults to 0. |
| RHPROXY_SERVICE_PORT | Use this option to define the listening port of the Red Hat Lightspeed proxy. This defaults to 3128. |
| RHPROXY_DNS_SERVER | Use this option to define which DNS server to use for name resolution. This defaults to 1.1.1.1. The rhproxy service will use the system DNS resolver if defined, otherwise it defaults to 1.1.1.1. |
| RHPROXY_WEB_SERVER_DISABLE | Use this option to disable the Red Hat Lightspeed proxy web server. This defaults to 0. |
| RHPROXY_WEB_SERVER_PORT | Use this option to define the listening port of the Red Hat Lightspeed proxy web server. This defaults to 8443. |