# Nginx Templates
Nginx templates allow you to customize the Nginx site configuration that Forge uses when creating your new site.
Broken Nginx Templates May Cause Downtime
Nginx templates that are not valid will prevent Nginx from properly working and your existing sites may stop responding. You should proceed with caution when creating and deploying custom Nginx templates.
# Creating Templates
You may create your own Nginx templates from within a server's management dashboard. When creating a new template, you need to provide a template name and the template's content. Forge will provide a default template that you may alter as required.
Although the default template does not show support for TLSv1.3, Forge will automatically update a site to support it if the server is able to do so.
# Template Variables
Forge provides several variables that can be used within your templates to dynamically alter their content for new sites:
| ||The site's configured web directory, e.g. |
| ||The site's configured domains to respond to, e.g. |
| ||The site's web accessible directory, e.g. |
| ||The IPv4 port the site should listen to (|
| ||The IPV6 port to listen to (|
| ||The PHP socket to listen on, e.g. |
| ||The root of the configured site, e.g. |
| ||The public IP address of the server|
| ||The private IP address of the server, if available|
| ||The site's name, e.g. |
| ||The site's ID, e.g. |
| ||The site's user, e.g. |
When using these variables, you should ensure that they exactly match the syntax shown above.
# Managing Templates
You may edit the name and content of your Nginx template at any time. Changes to a template will not affect existing sites that use the template.
Deleting a template will not remove any sites which were configured to use it.
# Circle Permissions
The ability to manage Nginx Templates is determined by the
site:manage-nginx permission. This permission is also used to restrict the ability to edit an existing site's Nginx configuration file.