Configuration settings of each virtual host are stored in its configuration files in the
/conf/ directory. Particularly, these files are the following:
_httpd.conf- Apache virtual host configuration.
_nginx.conf- nginx configuration.
The final Apache configuration will include all
nginx.conf files from all virtual hosts.
Plesk lets administrators and domain owners see the history of changes in a virtual host configuration files by saving each version of these files. <version> here is a unique number assigned to a certain configuration state that is used now or was used previously. To let administrators and domain owners easily access the currently used configuration file, Plesk stores the links
last_nginx.conf that point to the corresponding files.
The system re-generates the configuration files after each change of virtual host configuration, for example, changing the hosting type of a domain. Therefore, if you edit
nginx.conf files manually, your changes will be lost after changing the virtual host settings in the Plesk UI. To avoid this, additional files are used to specify custom configuration for domains:
vhost_ssl.conf- custom Apache directives for two situations: when clients access the site over HTTP and HTTPS respectively. These files are included in the
vhost_nginx.conf- custom nginx directives. This file is included in the
The files with custom per-domain configuration are stored in the
Most of the settings specified in these files override the server-wide configuration of a virtual host (
nginx.conf). For example, if you include directives that already exist in the site's current
httpd.conf file, the system will use your values from the
Editing Virtual Host Configuration Files
There are two ways to edit virtual host configuration files:
Manually. You can add custom directives to the following files from
In the Plesk GUI. On the Websites & Domains > select a website > Web Server Settings tab you can specify:
Common Apache settings. Most commonly used directives (like MIME types or index files). These directives will be included in
- nginx settings. Directives that define the scope of nginx's role in serving website's content of different types (static and dynamic).
Additional Apache directives. You can add several custom Apache directives at once in the Additional directives for HTTP and Additional directives for HTTPS fields. These fields correspond to
Additional nginx directives. You can add several custom nginx directives at once in the Additional nginx directives field. This field corresponds to
- Common Apache settings. Most commonly used directives (like MIME types or index files). These directives will be included in
The changes you made in the web server configuration will be applied automatically.
Note: If you have upgraded from the older Plesk version and are configuring the
vhost_ssl.conf files for the first time after the upgrade, you will need to use the
httpdmng utility to apply the changes from your configuration files. For example, to generate web server configuration files for a website, run the command:
/usr/local/psa/admin/sbin/httpdmng --reconfigure-domain <domain_name>