Repository: digitalocean/nginxconfig.io
File: src/nginxconfig/generators/index.js (JavaScript)

Code before:
import dockerComposeYaml from './yaml/dockerCompose.yaml';
import dockerConf from './ext/docker';

export default (domains, global) => {
    const files = {};

    // Base nginx config
    files['nginx.conf'] = toConf(nginxConf(domains, global));

    // Dockerfile
    if (global.docker.dockerfile.computed)
        files['Dockerfile'] = dockerConf();

    if (global.docker.dockerCompose.computed)
        files['docker-compose.yaml'] = toYaml(dockerComposeYaml());

    // Modularised configs
    if (global.tools.modularizedStructure.computed) {
        // Domain config
        const sitesDir = `sites-${global.tools.symlinkVhost.computed ? 'available' : 'enabled'}`;
        const ipPortPairs = new Set();
        for (const domain of domains) {
            files[`${sitesDir}/${domain.server.domain.computed}.conf`] = toConf(websiteConf(domain, domains, global, ipPortPairs));
            // WordPress
            if (domains.some(d => d.php.wordPressRules.computed))
                files['nginxconfig.io/wordpress.conf'] = toConf(wordPressConf(global, domain));
        }

        // Let's encrypt
        if (domains.some(d => d.https.certType.computed === 'letsEncrypt'))
            files['nginxconfig.io/letsencrypt.conf'] = toConf(letsEncryptConf(global));

        // Security
        files['nginxconfig.io/security.conf'] = toConf(securityConf(domains, global));

        // General
        files['nginxconfig.io/general.conf'] = toConf(generalConf(domains, global));

        // PHP
        if (domains.some(d => d.php.php.computed))
            files['nginxconfig.io/php_fastcgi.conf'] = toConf(phpConf(domains));

        // Python
        if (domains.some(d => d.python.python.computed))
            files['nginxconfig.io/python_uwsgi.conf'] = toConf(pythonConf(global));

        // Reverse proxy
        if (domains.some(d => d.reverseProxy.reverseProxy.computed))
            files['nginxconfig.io/proxy.conf'] = toConf(proxyConf(global));

        // Drupal

Review comment (suggestion):
```suggestion
                files[`nginxconfig.io/${domain.server.domain.computed}.wordpress.conf`] = toConf(wordPressConf(global, domain));
```
This will need a domain-specific filename, otherwise if you have two domains it'll over-write itself

`websiteConf` will also need be updated to include this by the correct filename (line 304)

Code after:
import dockerComposeYaml from './yaml/dockerCompose.yaml';
import dockerConf from './ext/docker';

export default (domains, global) => {
    const files = {};

    // Base nginx config
    files['nginx.conf'] = toConf(nginxConf(domains, global));

    // Dockerfile
    if (global.docker.dockerfile.computed)
        files['Dockerfile'] = dockerConf();

    if (global.docker.dockerCompose.computed)
        files['docker-compose.yaml'] = toYaml(dockerComposeYaml());

    // Modularised configs
    if (global.tools.modularizedStructure.computed) {
        // Domain config
        const sitesDir = `sites-${global.tools.symlinkVhost.computed ? 'available' : 'enabled'}`;
        const ipPortPairs = new Set();
        for (const domain of domains) {
            files[`${sitesDir}/${domain.server.domain.computed}.conf`] = toConf(websiteConf(domain, domains, global, ipPortPairs));
            // WordPress
            if (domains.some(d => d.php.wordPressRules.computed))
                files[`nginxconfig.io/${domain.server.domain.computed}.wordpress.conf`] = toConf(wordPressConf(global, domain));
        }

        // Let's encrypt
        if (domains.some(d => d.https.certType.computed === 'letsEncrypt'))
            files['nginxconfig.io/letsencrypt.conf'] = toConf(letsEncryptConf(global));

        // Security
        files['nginxconfig.io/security.conf'] = toConf(securityConf(domains, global));

        // General
        files['nginxconfig.io/general.conf'] = toConf(generalConf(domains, global));

        // PHP
        if (domains.some(d => d.php.php.computed))
            files['nginxconfig.io/php_fastcgi.conf'] = toConf(phpConf(domains));

        // Python
        if (domains.some(d => d.python.python.computed))
            files['nginxconfig.io/python_uwsgi.conf'] = toConf(pythonConf(global));

        // Reverse proxy
        if (domains.some(d => d.reverseProxy.reverseProxy.computed))
            files['nginxconfig.io/proxy.conf'] = toConf(proxyConf(global));

        // Drupal