Skip to content

Standalone server block not parsable #14

@SamuelMarks

Description

@SamuelMarks
server {
    # My comment here
    server_name domain.name;
    listen 443;

    location /api0 {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:5000/awesome;
        proxy_redirect off;
    }
}

With your basic crossplane.Parse example in your README, this errors:

{
  "status": "failed",
  "errors": [
    {
      "file": "/tmp/configs/merged_roots.conf",
      "line": 1,
      "error": "\"server\" directive is not allowed here in /tmp/configs/merged_roots.conf:1"
    },
    {
      "file": "/tmp/configs/merged_roots.conf",
      "line": 3,
      "error": "\"server_name\" directive is not allowed here in /tmp/configs/merged_roots.conf:3"
    },
    {
      "file": "/tmp/configs/merged_roots.conf",
      "line": 4,
      "error": "\"listen\" directive is not allowed here in /tmp/configs/merged_roots.conf:4"
    },
    {
      "file": "/tmp/configs/merged_roots.conf",
      "line": 6,
      "error": "\"location\" directive is not allowed here in /tmp/configs/merged_roots.conf:6"
    },
    {
      "file": "/tmp/configs/merged_roots.conf",
      "line": 7,
      "error": "\"proxy_set_header\" directive is not allowed here in /tmp/configs/merged_roots.conf:7"
    },
    {
      "file": "/tmp/configs/merged_roots.conf",
      "line": 8,
      "error": "\"proxy_set_header\" directive is not allowed here in /tmp/configs/merged_roots.conf:8"
    },
    {
      "file": "/tmp/configs/merged_roots.conf",
      "line": 9,
      "error": "\"proxy_set_header\" directive is not allowed here in /tmp/configs/merged_roots.conf:9"
    },
    {
      "file": "/tmp/configs/merged_roots.conf",
      "line": 10,
      "error": "\"proxy_set_header\" directive is not allowed here in /tmp/configs/merged_roots.conf:10"
    },
    {
      "file": "/tmp/configs/merged_roots.conf",
      "line": 11,
      "error": "\"proxy_set_header\" directive is not allowed here in /tmp/configs/merged_roots.conf:11"
    },
    {
      "file": "/tmp/configs/merged_roots.conf",
      "line": 12,
      "error": "\"proxy_pass\" directive is not allowed here in /tmp/configs/merged_roots.conf:12"
    },
    {
      "file": "/tmp/configs/merged_roots.conf",
      "line": 13,
      "error": "\"proxy_redirect\" directive is not allowed here in /tmp/configs/merged_roots.conf:13"
    }
  ],
  "config": [
    {
      "file": "/tmp/configs/merged_roots.conf",
      "status": "failed",
      "errors": [
        {
          "line": 1,
          "error": "\"server\" directive is not allowed here in /tmp/configs/merged_roots.conf:1"
        },
        {
          "line": 3,
          "error": "\"server_name\" directive is not allowed here in /tmp/configs/merged_roots.conf:3"
        },
        {
          "line": 4,
          "error": "\"listen\" directive is not allowed here in /tmp/configs/merged_roots.conf:4"
        },
        {
          "line": 6,
          "error": "\"location\" directive is not allowed here in /tmp/configs/merged_roots.conf:6"
        },
        {
          "line": 7,
          "error": "\"proxy_set_header\" directive is not allowed here in /tmp/configs/merged_roots.conf:7"
        },
        {
          "line": 8,
          "error": "\"proxy_set_header\" directive is not allowed here in /tmp/configs/merged_roots.conf:8"
        },
        {
          "line": 9,
          "error": "\"proxy_set_header\" directive is not allowed here in /tmp/configs/merged_roots.conf:9"
        },
        {
          "line": 10,
          "error": "\"proxy_set_header\" directive is not allowed here in /tmp/configs/merged_roots.conf:10"
        },
        {
          "line": 11,
          "error": "\"proxy_set_header\" directive is not allowed here in /tmp/configs/merged_roots.conf:11"
        },
        {
          "line": 12,
          "error": "\"proxy_pass\" directive is not allowed here in /tmp/configs/merged_roots.conf:12"
        },
        {
          "line": 13,
          "error": "\"proxy_redirect\" directive is not allowed here in /tmp/configs/merged_roots.conf:13"
        }
      ],
      "parsed": []
    }
  ]
}

In the meantime I'll just:

crossplane.ParseOptions{SkipDirectiveContextCheck: true, SkipDirectiveArgsCheck: true}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions