Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • I ISPConfig 3
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 551
    • Issues 551
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 41
    • Merge requests 41
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISPConfig
  • ISPConfig 3
  • Issues
  • #4639

Closed
Open
Created Apr 23, 2017 by Ramil Valitov@ram

Folder protection options can conflict with existing configured locations in nginx (locations merge problem)

The problem happens if the following both conditions are met:

  1. User configures a password protected folder in ISPConfig (Sites - Web Access - Protected Folders).
  2. The same folder is already configured in nginx (for example, in vhost template, directive snippets or web options).

In this case the locations are not merged by ISPConfig when it generates the final vhost configuration file. As a result, the file contains mupltiple locations that leads to nginx syntax error.

Example. Let's assume, we have "test" location configured in directive snippets:

location /test/ {
try_files $uri $uri/ /index.php?$args;
}

Then add "test" to the list of protected folders. The resulting configuration file that ISPConfig generates will be invalid:

location /test/ {
             try_files $uri $uri/ /index.php?$args;
        }

## some other nginx directives

location /test/ { ##merge##
                auth_basic "Members Only";
                auth_basic_user_file /var/www/clients/client1/web5/web/test/.htpasswd;

                location ~ \.php$ {
                    try_files /89f314d371fa173948fcad289dd51f95.htm @php;
                }
        }

Discussion at Howtoforge

Assignee
Assign to
Time tracking