Import and export configurations
Import an existing NGINX configuration from a tar.gz archive, also called a tarball, instead of creating each file in the console. You can also export any configuration version as a tar.gz archive.
Before you begin, make sure that:
- You can log in to the F5 ADS Console: See Access the F5 ADS Console.
- Your configuration follows the F5 ADS rules: Imported configurations follow the same rules as other configurations. See NGINX configuration rules and limits.
An archive that you import must meet these requirements:
- Must be a gzip-compressed tar file with the
.tar.gzor.tgzextension, in ustar, pax, or GNU tar format. - Must contain
/etc/nginx/nginx.conf, the main NGINX configuration file. - Each path must be the path of the file on the deployment. F5 ADS adds a leading
/if a path doesn’t have one, soetc/nginx/nginx.confand./etc/nginx/nginx.confboth become/etc/nginx/nginx.conf. - Its files must be in directories that you can upload to, such as
/etc/nginx,/opt,/srv, or/var/www. For the full list, see NGINX filesystem restrictions.
F5 ADS reads relative paths in NGINX directives from /etc/nginx. For example, include conf.d/*.conf; reads the files in /etc/nginx/conf.d.
The archive also has these size limits:
| Limit | Value |
|---|---|
| Archive size | 5 MB |
| Size of one file, uncompressed | 10 MB |
| Size of all files, uncompressed | 10 MB |
| Number of entries, including directories | 1,000 |
When you import an archive, F5 ADS:
- Skips directories, symbolic links, and other entries that aren’t regular files.
- Skips macOS metadata files:
.DS_Storeand files with names that start with._. It imports other hidden files, such as.htpasswd. - Ignores the file permissions and owners in the archive.
ImportantAn archive can contain certificates, private keys, and other secrets in plain text. Store and share the archive securely. To keep keys out of your configuration files, use managed SSL/TLS certificates.
Create the archive from the root directory (/) so that its paths start with etc/nginx/. If you create it from inside /etc/nginx, the archive doesn’t contain /etc/nginx/nginx.conf, and the import fails.
-
Create an archive named
nginx-config.tar.gzfrom the files in/etc/nginx:-
GNU tar (Linux):
tar --format=pax -czvf nginx-config.tar.gz -C / etc/nginx -
BSD tar (macOS):
COPYFILE_DISABLE=1 tar --format pax -czvf nginx-config.tar.gz -C / etc/nginx
These commands use the pax format. To use ustar, replace
paxwithustar. The ustar format can’t store paths longer than 255 characters. On macOS,COPYFILE_DISABLE=1keeps macOS metadata files out of the archive. -
-
List the files in the archive:
tar -tvzf nginx-config.tar.gzThe output must include
etc/nginx/nginx.conf:text drwxr-xr-x root/root 0 2026-11-23 10:00 etc/nginx/ drwxr-xr-x root/root 0 2026-11-23 10:00 etc/nginx/conf.d/ -rw-r--r-- root/root 412 2026-11-23 10:00 etc/nginx/conf.d/default.conf -rw-r--r-- root/root 1290 2026-11-23 10:00 etc/nginx/nginx.confAn archive that you export from F5 ADS shows
/etc/nginx/nginx.conf, with a leading/. You can import it without changes.
If your files aren’t in /etc/nginx, change the paths when you create the archive:
-
GNU tar (Linux):
tar --format=pax -czvf nginx-config.tar.gz --transform 's,^<SOURCE_DIRECTORY>,etc/nginx,' -C <PARENT_DIRECTORY> <SOURCE_DIRECTORY> -
BSD tar (macOS):
COPYFILE_DISABLE=1 tar --format pax -czvf nginx-config.tar.gz -s ',^<SOURCE_DIRECTORY>,etc/nginx,' -C <PARENT_DIRECTORY> <SOURCE_DIRECTORY>
Replace:
<SOURCE_DIRECTORY>with the directory that containsnginx.conf, for examplemy-nginx.<PARENT_DIRECTORY>with the directory that contains<SOURCE_DIRECTORY>, for example~.
-
On the left menu, select Configurations.
-
Select Add Configuration.
-
Select Import Configuration.
-
Enter a name for the configuration and an optional description.
-
Select Import from File.
-
Select Upload File, and then choose your archive.
-
Select Import.
If the archive is valid, you’ll see the message "File(s) were imported successfully."
-
Select Next.
-
Review the files in the editor, and fix any errors or warnings.
You can edit, add, rename, and delete files before you save the configuration.
-
Select Add Configuration.
F5 ADS creates the configuration and its first version. To apply it, update a deployment to use the configuration.
To export a version from the configuration list:
- On the left menu, select Configurations.
- Select the ellipsis (three dots) icon next to the configuration.
- Select Export.
- From the Version list, select the version to export.
- Select Export.
To export a version from the configuration details:
-
On the left menu, select Configurations, and then select the configuration.
-
Export a version:
- To export the version that’s open in the editor, select the Configuration tab, and then select Export.
- To export another version, select the Versions tab. Select the ellipsis (three dots) icon next to the version, and then select Export.
Your browser downloads a file named <VERSION_ID>.tar.gz, where <VERSION_ID> is the ID of the configuration version.
The archive:
- Contains the files of one configuration version as they were submitted, at their full paths, such as
/etc/nginx/nginx.conf. - Sets the permissions of all files to
0644. - Doesn’t contain managed certificates and keys, or references to secrets in a cloud secret manager. If you import the archive, add these again.
To extract the archive, use the -C option with a new directory. tar removes the leading / from the paths, so the files go into exported-config/etc/nginx/:
mkdir exported-config
tar -xzvf <VERSION_ID>.tar.gz -C exported-configCautionDon’t extract the archive in the root directory (/) of a system that runs NGINX, and don’t use the-P(--absolute-names) option. Both replace the files in/etc/nginx.
Symptom: The import fails with the message "the archive must contain /etc/nginx/nginx.conf, which must be the main NGINX configuration file."
Cause: The archive doesn’t have a file at /etc/nginx/nginx.conf. This happens when you create the archive from inside /etc/nginx, so the paths start with ./ or nginx.conf.
Fix: Create the archive from the root directory. See Create an archive.
Symptom: The import fails with the message "the configuration archive must be 5MB or less," or with a message that starts with a file name and too large, total uncompressed size too large, or too many entries.
Cause: The archive or one of its files is over a limit in Archive requirements.
Fix: Remove files that NGINX doesn’t need, such as logs or backups, and create the archive again.
For more information, see: