Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add indent for nginx.conf #1277

Merged
merged 1 commit into from
Aug 31, 2017
Merged

Add indent for nginx.conf #1277

merged 1 commit into from
Aug 31, 2017

Conversation

danielqsj
Copy link
Contributor

Currently, the generated nginx.conf looks like:

        location ~* ^/session-demo\/?(?<baseuri>.*) {
        set $proxy_upstream_name "sticky-org1-session-demo-80";

        set $namespace      "org1";
        set $ingress_name   "session-demo-test";
        set $service_name   "";

        port_in_redirect off;

        client_max_body_size                    "1m";

        proxy_set_header Host                   $best_http_host;

        # Pass the extracted client certificate to the backend

        # Allow websocket connections
        proxy_set_header                        Upgrade           $http_upgrade;
        proxy_set_header                        Connection        $connection_upgrade;

        proxy_set_header X-Real-IP              $the_real_ip;
        proxy_set_header X-Forwarded-For        $the_real_ip;
        proxy_set_header X-Forwarded-Host       $best_http_host;
        proxy_set_header X-Forwarded-Port       $pass_port;
        proxy_set_header X-Forwarded-Proto      $pass_access_scheme;
        proxy_set_header X-Original-URI         $request_uri;
        proxy_set_header X-Scheme               $pass_access_scheme;

        # mitigate HTTPoxy Vulnerability
        # https://www.nginx.com/blog/mitigating-the-httpoxy-vulnerability-with-nginx/
        proxy_set_header Proxy                  "";

        # Custom headers to proxied server

        proxy_connect_timeout                   5s;
        proxy_send_timeout                      60s;
        proxy_read_timeout                      60s;

        proxy_redirect                          off;
        proxy_buffering                         off;
        proxy_buffer_size                       "4k";
        proxy_buffers                           4 "4k";

        proxy_http_version                      1.1;

        proxy_cookie_domain                     off;
        proxy_cookie_path                       off;

        # In case of errors try the next upstream server before returning an error
        proxy_next_upstream                     error timeout invalid_header http_502 http_503 http_504;

        proxy_set_header                        Accept-Encoding     "";

        rewrite /session-demo/(.*) /$1 break;
        rewrite /session-demo / break;
        proxy_pass http://sticky-org1-session-demo-80;
        subs_filter '<head(.*)>' '<head$1><base href="https://$http_host/session-demo/$baseuri">' r;
        subs_filter '<HEAD(.*)>' '<HEAD$1><base href="https://$http_host/session-demo/$baseuri">' r;

        }

The indent is missing, the following looks good.

        location ~* ^/session-demo\/?(?<baseuri>.*) {
            set $proxy_upstream_name "sticky-org1-session-demo-80";

            set $namespace      "org1";
            set $ingress_name   "session-demo-test";
            set $service_name   "";

            port_in_redirect off;

            client_max_body_size                    "1m";

            proxy_set_header Host                   $best_http_host;

            # Pass the extracted client certificate to the backend

            # Allow websocket connections
            proxy_set_header                        Upgrade           $http_upgrade;
            proxy_set_header                        Connection        $connection_upgrade;

            proxy_set_header X-Real-IP              $the_real_ip;
            proxy_set_header X-Forwarded-For        $the_real_ip;
            proxy_set_header X-Forwarded-Host       $best_http_host;
            proxy_set_header X-Forwarded-Port       $pass_port;
            proxy_set_header X-Forwarded-Proto      $pass_access_scheme;
            proxy_set_header X-Original-URI         $request_uri;
            proxy_set_header X-Scheme               $pass_access_scheme;

            # mitigate HTTPoxy Vulnerability
            # https://www.nginx.com/blog/mitigating-the-httpoxy-vulnerability-with-nginx/
            proxy_set_header Proxy                  "";

            # Custom headers to proxied server

            proxy_connect_timeout                   5s;
            proxy_send_timeout                      60s;
            proxy_read_timeout                      60s;

            proxy_redirect                          off;
            proxy_buffering                         off;
            proxy_buffer_size                       "4k";
            proxy_buffers                           4 "4k";

            proxy_http_version                      1.1;

            proxy_cookie_domain                     off;
            proxy_cookie_path                       off;

            # In case of errors try the next upstream server before returning an error
            proxy_next_upstream                     error timeout invalid_header http_502 http_503 http_504;

            proxy_set_header                        Accept-Encoding     "";

            rewrite /session-demo/(.*) /$1 break;
            rewrite /session-demo / break;
            proxy_pass http://sticky-org1-session-demo-80;
            subs_filter '<head(.*)>' '<head$1><base href="https://$http_host/session-demo/$baseuri">' r;
            subs_filter '<HEAD(.*)>' '<HEAD$1><base href="https://$http_host/session-demo/$baseuri">' r;

        }

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 31, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 31, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 43.613% when pulling aa04272 on danielqsj:add-indent into ae44d8e on kubernetes:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 43.613% when pulling e9a14cb on danielqsj:add-indent into ae44d8e on kubernetes:master.

@aledbf aledbf self-assigned this Aug 31, 2017
@aledbf
Copy link
Member

aledbf commented Aug 31, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 31, 2017
@aledbf
Copy link
Member

aledbf commented Aug 31, 2017

@danielqsj thanks!

@aledbf aledbf merged commit abc53cc into kubernetes:master Aug 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants