gixy icon indicating copy to clipboard operation
gixy copied to clipboard

Fail on nested `if` statements

Open fabioknoedt opened this issue 7 years ago • 2 comments

Nginx doesn't support nested if statements: http://rosslawley.co.uk/archive/old/2010/01/04/nginx-how-to-multiple-if-statements/

Does it make sense to detect these syntax errors?

fabioknoedt avatar Nov 23 '17 14:11 fabioknoedt

I think the detection of syntax errors does not need for gixy. For this purpose I prefer to run nginx -t, benefits:

  • checks the availability of the necessary modules;
  • zero false positive :-)

buglloc avatar Nov 23 '17 14:11 buglloc

Good point. My use case is in a piece of nginx configuration inside of an ingress config snippet though: ingress.kubernetes.io/configuration-snippet, it's not the whole config file. I know, edge case 😄

metadata:
  name: my-name
  annotations:
    kubernetes.io/ingress.class: nginx
    ingress.kubernetes.io/force-ssl-redirect: "true"
    ingress.kubernetes.io/proxy-body-size: '0'
    ingress.kubernetes.io/configuration-snippet: |
        <snippet here>

fabioknoedt avatar Nov 23 '17 15:11 fabioknoedt