Skip to content

Root should not be inside location block #142

@schkovich

Description

@schkovich

Bad practice is currently enforced: fail('Cannot create a location reference without a www_root [...]).

Instead option to add www_root should be removed and error raised if user tries to add root inside location block.

Nginx Pitfalls: Root inside location block

BAD:

server {
    server_name www.domain.com;
    location / {
      root /var/www/nginx-default/;
      [...]
    }
}

GOOD:

server {
  server_name www.domain.com;
  root /var/www/nginx-default/;
  location / {
    [...]
  }

Root moved to vhost_header

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions