How to work with configuration files
Last updated: · Applies to Roxy-WI 9.2 and later.
With Roxy-WI, you can easily configure HAProxy, NGINX, Apache and Keepalived through the web interface. Roxy-WI offers the following features:
- view and edit sections of configuration files;
- monitor statistics for each server;
- visualize the network structure;
- compare the current configuration file with previous versions;
- store previous versions of configuration files and roll back to them when necessary.
To begin configuring HAProxy, go to the HAProxy => Configs section. From the drop-down list, choose the server you wish to configure and click Open.
You will see a list of sections from the configuration file. Clicking on a section name will expand it, revealing the associated parameters. To edit or delete a section, click the corresponding link in the upper right corner. Editing the configuration file through Roxy-WI is more straightforward than using a text editor, as the web interface clearly visualizes the sections, making it particularly convenient for managing large configuration files.
Multiple HAProxy configuration files
In 9.2, HAProxy can use several configuration files. Open the server's HAProxy service settings and enable Use multiple configuration files. This is a per-server setting; it does not rewrite how HAProxy starts. Without it, the editor continues to use the configured main file.
- Check the group's
haproxy_dirandhaproxy_config_path, plus the service's Docker setting and container name if applicable. - Inspect the detected configuration sources. Roxy-WI reads systemd startup settings or the Docker container command to determine the ordered
-ffiles/directories and reports whether the running process was verified. - If the service still loads only one file, follow the setup hint. For systemd, add the directory to ExecStart and the validation commands in ExecStartPre/ExecReload, run
systemctl daemon-reloadand restart HAProxy. For Docker, mount the configuration directory read-write, add its-fargument to the container command and recreate the container. Retain the other startup options. For example, the source arguments can be-f /etc/haproxy/haproxy.cfg -f /etc/haproxy/conf.d; use the actual paths for your installation. - Click Check again. When sources are ready, open HAProxy → Configs, select a file and click Open. Use Create new config for a new
.cfgfile inside the service directory; the file must be included by the startup sources. - Edit the selected file, review it and choose the permitted Save/Reload/Restart action or create a Change Center request.
Roxy-WI validates the complete HAProxy configuration with the candidate file in place. A fragment does not need to be a standalone HAProxy configuration. A validation or reload/restart failure triggers restoration; inspect any recovery failure before another attempt.
File selection is retained for section editing, saved versions and Change Center. Before restoring a version, verify both its server and file path. In Docker, verify the displayed host/container path mapping and persistent mounts. If discovery fails, check SSH, Python 3, noninteractive sudo and the configured service/container name instead of guessing which files HAProxy loads.
Read and search a configuration
The 9.2 viewer offers collapsible sections and a full-source view. Search the displayed content, move between matches, copy the configuration and toggle line wrapping. Use full source when the surrounding directives matter; expanding a section does not edit it.
Keep the selected server and file in view before opening the editor or restoring a saved version. For a group requiring Change Center, use its approval/deployment workflow; viewing or saving a draft does not deploy it.
To edit the NGINX configuration file, go to the NGINX => Configs section. You will see a dropdown menu similar to that of HAProxy. Select the server for which you want to edit the configuration and click Open.
Since version 5.4.0, Roxy-WI allows you to edit multiple NGINX configuration files through the graphical interface, which is useful if you store several configurations on a single host. Configuration files are selected from the nginx_dir service directory; nginx_config_path identifies the main configuration file (Admin area → Settings). You can choose the configuration file to edit from the drop-down list.
Then, click Open to begin editing the file. The editing options for NGINX configurations are similar to those available for HAProxy.
To edit the Apache/Keepalived configuration file, go to the Apache/Keepalived => Configs section. You will see a dropdown menu similar to those for HAProxy and NGINX. Select the server for which you want to edit the configuration and click Open. The interface for adding and editing configuration files is identical to that of NGINX.
With Roxy-WI, you can compare the current version of the configuration file with previous versions. This feature is particularly useful for identifying errors. If HAProxy fails to run after a configuration change, you can compare the two files to determine the potential cause of the issue. To compare two versions of the configuration files, go to the Configs section and click Compare. Select the files you wish to compare from the left and right drop-down lists, then click Compare on the right.
The comparison highlights the differences between the selected files.
Roxy-WI stores all previously used configuration files. To view the available versions, click Versions on the Configs page. You will see the list of versions as shown below:
Select the desired version by checking the box next to it. To view the differences between the selected version and the current configuration file, click Show diff. The comparison shows the differences against the current configuration.
To view the full configuration file, click View/Upload. You can perform the following actions on the previously opened configuration (each action has a corresponding button at the bottom of the page):
- upload the previous configuration to the server without applying it (Save button);
- upload the previous configuration and apply it after restarting the service (Upload and Restart button);
- upload the previous configuration and instruct the service to reread the configuration file (Upload and Reload button).