Coder Social home page Coder Social logo

nginx-buildpack's Introduction

Cloud Foundry NGINX Buildpack

CF Slack Join us on Slack

A Cloud Foundry buildpack for apps requiring NGINX.

Buildpack User Documentation

Official buildpack documentation can be found at here.

To use this buildpack, you will need to include an nginx.conf file in your app. Here's an example.

Building the Buildpack

To build this buildpack, run the following command from the buildpack's directory:

  1. Source the .envrc file in the buildpack directory.

    source .envrc

    To simplify the process in the future, install direnv which will automatically source .envrc when you change directories.

  2. Install buildpack-packager

    ./scripts/install_tools.sh
  3. Build the buildpack

    buildpack-packager build [ -cached=(true|false) ] -any-stack
  4. Use in Cloud Foundry

    Upload the buildpack to your Cloud Foundry and optionally specify it by name

    cf create-buildpack [BUILDPACK_NAME] [BUILDPACK_ZIP_FILE_PATH] 1
    cf push my_app [-b BUILDPACK_NAME]

Testing

Buildpacks use the Cutlass framework for running integration tests.

To test this buildpack, run the following command from the buildpack's directory:

  1. Source the .envrc file in the buildpack directory.

    source .envrc

    To simplify the process in the future, install direnv which will automatically source .envrc when you change directories.

  2. Run unit tests

    ./scripts/unit.sh
  3. Run integration tests

    ./scripts/integration.sh

More information can be found on Github cutlass.

Contributing

Find our guidelines here.

Help and Support

Join the #buildpacks channel in our Slack community

Reporting Issues

Open an issue on this project

Active Development

The project backlog is on Pivotal Tracker

nginx-buildpack's People

Contributors

accrazed avatar ameyer-pivotal avatar anyu avatar arjun024 avatar astrieanna avatar ben16 avatar brayanhenao avatar cf-buildpacks-eng avatar dependabot[bot] avatar dfreilich avatar dgodd avatar dwillist avatar eshanks-pivotal avatar foresteckhardt avatar idoru avatar jfeeny avatar joshzarrabi avatar kardolus avatar kinjelom avatar kvedurmu avatar mdelillo avatar meibensteiner avatar menehune23 avatar mvalliath avatar ndon55555 avatar ryanmoran avatar sclevine avatar sophiewigmore avatar thitch97 avatar tisvictress avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nginx-buildpack's Issues

http to https redirect not working

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?
{
"name": "Name",
"build": "2.10.5-build.14",
"version": 0,
"min_cli_version": "6.23.0",
"min_recommended_cli_version": "6.23.0",
"app_ssh_oauth_client": "ssh-proxy",
"api_version": "2.150.0",
"osbapi_version": "2.15"
}
cf version 7.2.0+be4a5ce2b.2020-12-10

What version of the buildpack you are using?
v1.1.20

If you were attempting to accomplish a task, what was it you were attempting to do?
redirect all http requests to https.

What did you expect to happen?
It should have redirected from http to https

What was the actual behavior?
Struggling to redirect http to https using nginx config. Please let us know if anyone has done the same using nginx-buildpack.
I have even used the same nginx config as generated by staticfile-buildpack with Force-https true. That has also not worked.

Please confirm where necessary:

  • I have included a log output - No logs for http requests
  • My log includes an error message - No error message
  • I have included steps for reproduction - Attaching the nginx.conf file below.

NGINX.CONF

worker_processes 1;
daemon off;

error_log stderr;
events { worker_connections 1024; }

http {
  charset utf-8;
  log_format cloudfoundry 'NginxLog "$request" $status $body_bytes_sent';
  access_log /dev/stdout cloudfoundry;
  default_type application/octet-stream;
  include mime.types;
  sendfile on;

  tcp_nopush on;
  keepalive_timeout 30;
  port_in_redirect off; # Ensure that redirects don't include the internal container PORT - 8080

  # server {
  #   listen 80;
  #   server_name _;
  #   return 301 https://$host$request_uri;
  # }

  server {
    listen {{port}};
    root /app;
    index index.html index.htm Default.htm;

    set $updated_host $host;
    if ($http_x_forwarded_host != "") {
      set $updated_host $http_x_forwarded_host;
    } 

    if ($http_x_forwarded_proto != "https") {
      return 301 https://$updated_host$request_uri;
    }

    # configuration endpoint

    location /test {
      default_type application/json;

      set $override "{{env "OVERRIDE"}}";

      if ($override != '') {
          return 200 "{{env "OVERRIDE"}}";
      }

      return 200 "No overrides happening! \"abc\"";
    }

    location /SAAS {
      proxy_pass some_url;
      proxy_http_version 1.1;
    }

    location /oauthtoken {
      proxy_pass some_url;
      proxy_http_version 1.1;
    }

    location / {
      try_files $uri $uri/ /index.html;

      root /app;
      index index.html index.htm;
    }
  }
}

ERR go: finding github.com/golang/mock v1.2.0

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?

{
   "name": "IBM Cloud",
   "build": "1.19",
   "support": "http://ibm.biz/bluemix-supportinfo",
   "version": 0,
   "description": "IBM Bluemix",
   "authorization_endpoint": "https://login.ng.bluemix.net/UAALoginServerWAR",
   "token_endpoint": "https://uaa.ng.bluemix.net",
   "min_cli_version": null,
   "min_recommended_cli_version": null,
   "api_version": "2.106.0",
   "app_ssh_endpoint": "ssh.ng.bluemix.net:2222",
   "app_ssh_host_key_fingerprint": "c7:1f:89:2a:62:3b:78:a9:08:c9:33:81:fb:39:26:da",
   "app_ssh_oauth_client": "ssh-proxy",
   "doppler_logging_endpoint": "wss://doppler.ng.bluemix.net:443",
   "bits_endpoint": "https://bits-service.ng.bluemix.net",
   "user": "78e54c96-5069-4b3b-9f95-43f390e25394"
}
cf version 6.42.0+0cba12168.2019-01-10

What version of the buildpack you are using?
1.0.6

If you were attempting to accomplish a task, what was it you were attempting to do?
Pushing an application using cf push APP_NAME -b https://github.com/cloudfoundry/nginx-buildpack.git -m 64M -i 1 --no-route

What did you expect to happen?
I did not expect to see errors.

What was the actual behavior?

2019-01-25T16:55:38.94-0500 [STG/0] OUT Downloaded build artifacts cache (3.2M)
   2019-01-25T16:55:39.42-0500 [STG/0] OUT Downloaded app package (2.7M)
   2019-01-25T16:55:40.89-0500 [STG/0] OUT -----> Download go 1.11.4
   2019-01-25T16:55:54.66-0500 [STG/0] OUT -----> Running go build supply
   2019-01-25T16:55:54.66-0500 [STG/0] OUT /tmp/buildpackdownloads/adf6125a52c1a65c9523985b5a87ec38 ~
   2019-01-25T16:55:54.75-0500 [STG/0] ERR go: finding github.com/golang/mock v1.2.0
   2019-01-25T16:55:54.75-0500 [STG/0] ERR go: finding github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4
   2019-01-25T16:55:54.75-0500 [STG/0] ERR go: finding github.com/onsi/ginkgo v1.7.0
   2019-01-25T16:55:54.76-0500 [STG/0] ERR go: finding github.com/cloudfoundry/libbuildpack v0.0.0-20190115190946-c10a4cd29881
   2019-01-25T16:55:54.76-0500 [STG/0] ERR go: finding github.com/onsi/gomega v1.4.3
   2019-01-25T16:55:54.77-0500 [STG/0] ERR go: finding github.com/inconshreveable/go-vhost v0.0.0-20160627193104-06d84117953b
   2019-01-25T16:55:55.16-0500 [STG/0] ERR go: finding golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9
   2019-01-25T16:55:55.21-0500 [STG/0] ERR go: finding golang.org/x/tools v0.0.0-20181203201058-99b2a93e1f84
   2019-01-25T16:55:55.30-0500 [STG/0] ERR go: finding cloud.google.com/go v0.33.1
   2019-01-25T16:55:55.31-0500 [STG/0] ERR go: finding go4.org v0.0.0-20181109185143-00e24f1b2599
   2019-01-25T16:55:56.73-0500 [STG/0] ERR go: finding golang.org/x/net v0.0.0-20180906233101-161cd47e91fd
   2019-01-25T16:55:56.76-0500 [STG/0] ERR go: finding golang.org/x/text v0.3.0
   2019-01-25T16:55:56.87-0500 [STG/0] ERR go: finding golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f
   2019-01-25T16:55:57.02-0500 [STG/0] ERR go: finding github.com/golang/protobuf v1.2.0
   2019-01-25T16:55:57.79-0500 [STG/0] ERR go: finding gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
   2019-01-25T16:55:58.38-0500 [STG/0] ERR go: finding github.com/fsnotify/fsnotify v1.4.7
   2019-01-25T16:56:00.37-0500 [STG/0] ERR go: finding gopkg.in/fsnotify.v1 v1.4.7
   2019-01-25T16:56:00.66-0500 [STG/0] ERR go: finding golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e
   2019-01-25T16:56:00.69-0500 [STG/0] ERR go: finding golang.org/x/build v0.0.0-20181121152522-2b0e3d65700e
   2019-01-25T16:56:00.72-0500 [STG/0] ERR go: finding github.com/tidwall/match v1.0.1
   2019-01-25T16:56:00.79-0500 [STG/0] ERR go: finding github.com/google/subcommands v0.0.0-20181012225330-46f0354f6315
   2019-01-25T16:56:01.47-0500 [STG/0] ERR go: finding gopkg.in/yaml.v2 v2.2.1
   2019-01-25T16:56:01.54-0500 [STG/0] ERR go: finding gopkg.in/yaml.v2 v2.2.2
   2019-01-25T16:56:01.56-0500 [STG/0] ERR go: finding github.com/blang/semver v3.5.1+incompatible
   2019-01-25T16:56:02.28-0500 [STG/0] ERR go: finding golang.org/x/net v0.0.0-20181220203305-927f97764cc3
   2019-01-25T16:56:02.31-0500 [STG/0] ERR go: finding github.com/kr/pretty v0.1.0
   2019-01-25T16:56:03.40-0500 [STG/0] ERR go: finding github.com/elazarl/goproxy v0.0.0-20181111060418-2ce16c963a8a
   2019-01-25T16:56:04.62-0500 [STG/0] ERR go: finding github.com/tidwall/gjson v1.1.3
   2019-01-25T16:56:05.07-0500 [STG/0] ERR go: finding golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4
   2019-01-25T16:56:05.14-0500 [STG/0] ERR go: finding golang.org/x/sys v0.0.0-20181029174526-d69651ed3497
   2019-01-25T16:56:05.16-0500 [STG/0] ERR go: finding github.com/hpcloud/tail v1.0.0
   2019-01-25T16:56:05.30-0500 [STG/0] ERR go: finding github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133
   2019-01-25T16:56:05.32-0500 [STG/0] ERR go: finding github.com/shurcooL/gofontwoff v0.0.0-20180329035133-29b52fc0a18d
   2019-01-25T16:56:05.34-0500 [STG/0] ERR go: finding github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d
   2019-01-25T16:56:05.38-0500 [STG/0] ERR go: finding gopkg.in/jarcoal/httpmock.v1 v1.0.0-20181117152235-275e9df93516
   2019-01-25T16:56:05.45-0500 [STG/0] ERR go: finding github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab
   2019-01-25T16:56:07.26-0500 [STG/0] ERR go: finding github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4
   2019-01-25T16:56:07.33-0500 [STG/0] ERR go: finding github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e
   2019-01-25T16:56:07.62-0500 [STG/0] ERR go: finding github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1
   2019-01-25T16:56:07.73-0500 [STG/0] ERR go: finding github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537
   2019-01-25T16:56:08.01-0500 [STG/0] ERR go: finding github.com/kr/text v0.1.0
   2019-01-25T16:56:08.17-0500 [STG/0] ERR go: finding github.com/googleapis/gax-go v2.0.0+incompatible
   2019-01-25T16:56:08.31-0500 [STG/0] ERR go: finding gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
   2019-01-25T16:56:08.41-0500 [STG/0] ERR go: finding github.com/shurcooL/highlight_go v0.0.0-20181028180052-98c3abbbae20
   2019-01-25T16:56:08.90-0500 [STG/0] ERR go: finding dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412
   2019-01-25T16:56:08.91-0500 [STG/0] ERR go: finding dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0
   2019-01-25T16:56:09.85-0500 [STG/0] ERR go: finding github.com/kr/pty v1.1.3
   2019-01-25T16:56:10.47-0500 [STG/0] ERR go: finding github.com/davecgh/go-spew v1.1.1
   2019-01-25T16:56:10.47-0500 [STG/0] ERR go: finding github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568
   2019-01-25T16:56:10.73-0500 [STG/0] ERR go: finding github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371
   2019-01-25T16:56:10.77-0500 [STG/0] ERR go: finding github.com/dustin/go-humanize v1.0.0
   2019-01-25T16:56:11.20-0500 [STG/0] ERR go: finding cloud.google.com/go v0.31.0
   2019-01-25T16:56:11.30-0500 [STG/0] ERR go: finding github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95
   2019-01-25T16:56:11.77-0500 [STG/0] ERR go: finding github.com/Masterminds/semver v1.4.2
   2019-01-25T16:56:12.13-0500 [STG/0] ERR go: finding golang.org/x/sys v0.0.0-20181221143128-b4a75ba826a6
   2019-01-25T16:56:12.26-0500 [STG/0] ERR go: finding github.com/onsi/ginkgo v1.6.0
   2019-01-25T16:56:13.39-0500 [STG/0] ERR go: finding grpc.go4.org v0.0.0-20170609214715-11d0a25b4919
   2019-01-25T16:56:13.57-0500 [STG/0] ERR go: finding golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16
   2019-01-25T16:56:13.78-0500 [STG/0] ERR go: finding github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1
   2019-01-25T16:56:13.79-0500 [STG/0] ERR go: finding golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2
   2019-01-25T16:56:14.17-0500 [STG/0] ERR go: finding github.com/shurcooL/home v0.0.0-20181020052607-80b7ffcb30f9
   2019-01-25T16:56:14.54-0500 [STG/0] ERR go: finding github.com/shurcooL/httpgzip v0.0.0-20180522190206-b1c53ac65af9
   2019-01-25T16:56:14.76-0500 [STG/0] ERR go: finding gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127
   2019-01-25T16:56:14.88-0500 [STG/0] ERR go: finding github.com/microcosm-cc/bluemonday v1.0.1
   2019-01-25T16:56:15.09-0500 [STG/0] ERR go: finding google.golang.org/api v0.0.0-20181030000543-1d582fd0359e
   2019-01-25T16:56:15.48-0500 [STG/0] ERR go: finding google.golang.org/appengine v1.2.0
   2019-01-25T16:56:15.63-0500 [STG/0] ERR go: finding github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470
   2019-01-25T16:56:16.14-0500 [STG/0] ERR go: finding sourcegraph.com/sourcegraph/go-diff v0.5.0
   2019-01-25T16:56:17.88-0500 [STG/0] ERR go: finding golang.org/x/net v0.0.0-20181029044818-c44066c5c816
   2019-01-25T16:56:18.06-0500 [STG/0] ERR go: finding github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239
   2019-01-25T16:56:18.22-0500 [STG/0] ERR go: finding github.com/kr/pty v1.1.1
   2019-01-25T16:56:18.57-0500 [STG/0] ERR go: finding go.opencensus.io v0.18.0
   2019-01-25T16:56:18.83-0500 [STG/0] ERR go: finding google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2
   2019-01-25T16:56:19.15-0500 [STG/0] ERR go: finding golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b
   2019-01-25T16:56:19.30-0500 [STG/0] ERR go: finding go4.org v0.0.0-20180809161055-417644f6feb5
   2019-01-25T16:56:19.54-0500 [STG/0] ERR go: finding github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d
   2019-01-25T16:56:19.69-0500 [STG/0] ERR go: finding github.com/google/go-github v17.0.0+incompatible
   2019-01-25T16:56:20.16-0500 [STG/0] ERR go: finding github.com/shurcooL/notifications v0.0.0-20181007000457-627ab5aea122
   2019-01-25T16:56:20.36-0500 [STG/0] ERR go: finding golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852
   2019-01-25T16:56:22.13-0500 [STG/0] ERR go: finding github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625
   2019-01-25T16:56:22.91-0500 [STG/0] ERR go: finding github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e
   2019-01-25T16:56:23.85-0500 [STG/0] ERR go: finding github.com/sergi/go-diff v1.0.0
   2019-01-25T16:56:23.91-0500 [STG/0] ERR go: finding github.com/BurntSushi/toml v0.3.1
   2019-01-25T16:56:24.31-0500 [STG/0] ERR go: finding github.com/shurcooL/issues v0.0.0-20181008053335-6292fdc1e191
   2019-01-25T16:56:24.73-0500 [STG/0] ERR go: finding github.com/google/go-cmp v0.2.0
   2019-01-25T16:56:25.96-0500 [STG/0] ERR go: finding github.com/ghodss/yaml v1.0.0
   2019-01-25T16:56:26.87-0500 [STG/0] ERR go: finding google.golang.org/genproto v0.0.0-20180831171423-11092d34479b
   2019-01-25T16:56:26.99-0500 [STG/0] ERR go: finding github.com/shurcooL/gopherjslib v0.0.0-20160914041154-feb6d3990c2c
   2019-01-25T16:56:27.46-0500 [STG/0] ERR go: finding github.com/shurcooL/issuesapp v0.0.0-20180602232740-048589ce2241
   2019-01-25T16:56:27.52-0500 [STG/0] ERR go: finding gopkg.in/inf.v0 v0.9.1
   2019-01-25T16:56:28.02-0500 [STG/0] ERR go: finding github.com/shurcooL/htmlg v0.0.0-20170918183704-d01228ac9e50
   2019-01-25T16:56:28.22-0500 [STG/0] ERR go: finding github.com/gogo/protobuf v1.1.1
   2019-01-25T16:56:28.54-0500 [STG/0] ERR go: finding dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c
   2019-01-25T16:56:29.03-0500 [STG/0] ERR go: finding github.com/grpc-ecosystem/grpc-gateway v1.5.0
   2019-01-25T16:56:29.04-0500 [STG/0] ERR go: finding dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3
   2019-01-25T16:56:30.18-0500 [STG/0] ERR go: finding github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86
   2019-01-25T16:56:30.56-0500 [STG/0] ERR go: finding github.com/shurcooL/octicon v0.0.0-20181028054416-fa4f57f9efb2
   2019-01-25T16:56:31.14-0500 [STG/0] ERR go: finding github.com/matttproud/golang_protobuf_extensions v1.0.1
   2019-01-25T16:56:31.79-0500 [STG/0] ERR go: finding git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999
   2019-01-25T16:56:33.99-0500 [STG/0] ERR go: finding google.golang.org/grpc v1.16.0
   2019-01-25T16:56:34.38-0500 [STG/0] ERR go: finding sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4
   2019-01-25T16:56:35.04-0500 [STG/0] ERR go: finding github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
   2019-01-25T16:56:35.28-0500 [STG/0] ERR go: finding github.com/openzipkin/zipkin-go v0.1.1
   2019-01-25T16:56:36.42-0500 [STG/0] ERR go: finding github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e
   2019-01-25T16:56:36.49-0500 [STG/0] ERR go: finding google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf
   2019-01-25T16:56:38.98-0500 [STG/0] ERR go: finding github.com/google/go-querystring v1.0.0
   2019-01-25T16:56:39.56-0500 [STG/0] ERR go: finding github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7
   2019-01-25T16:56:40.11-0500 [STG/0] ERR go: finding github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973
   2019-01-25T16:56:40.93-0500 [STG/0] ERR go: finding github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041
   2019-01-25T16:56:41.39-0500 [STG/0] ERR go: finding honnef.co/go/tools v0.0.0-20180728063816-88497007e858
   2019-01-25T16:56:41.41-0500 [STG/0] ERR go: finding golang.org/x/net v0.0.0-20180826012351-8a410e7b638d
   2019-01-25T16:56:41.49-0500 [STG/0] ERR go: finding github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48
   2019-01-25T16:56:41.91-0500 [STG/0] ERR go: finding golang.org/x/sys v0.0.0-20180830151530-49385e6e1522
   2019-01-25T16:56:41.98-0500 [STG/0] ERR go: finding github.com/client9/misspell v0.3.4
   2019-01-25T16:56:43.80-0500 [STG/0] ERR go: finding google.golang.org/appengine v1.1.0
   2019-01-25T16:56:44.54-0500 [STG/0] ERR go: finding golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4
   2019-01-25T16:56:46.31-0500 [STG/0] ERR go: finding github.com/golang/mock v1.1.1
   2019-01-25T16:56:47.08-0500 [STG/0] ERR go: finding github.com/prometheus/client_golang v0.8.0
   2019-01-25T16:56:47.79-0500 [STG/0] ERR go: finding cloud.google.com/go v0.26.0
   2019-01-25T16:56:47.95-0500 [STG/0] ERR go: finding github.com/shurcooL/httperror v0.0.0-20170206035902-86b7830d14cc
   2019-01-25T16:56:48.00-0500 [STG/0] ERR go: finding github.com/golang/lint v0.0.0-20180702182130-06c8688daad7
   2019-01-25T16:56:48.17-0500 [STG/0] ERR go: finding golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be
   2019-01-25T16:56:48.49-0500 [STG/0] ERR go: finding github.com/pmezard/go-difflib v1.0.0
   2019-01-25T16:56:48.50-0500 [STG/0] ERR go: finding github.com/kisielk/gotool v1.0.0
   2019-01-25T16:56:49.74-0500 [STG/0] ERR go: finding github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b
   2019-01-25T16:56:51.12-0500 [STG/0] ERR go: finding github.com/russross/blackfriday v1.5.2
   2019-01-25T16:56:52.24-0500 [STG/0] ERR go: finding github.com/stretchr/testify v1.2.2
   2019-01-25T16:56:52.48-0500 [STG/0] ERR go: finding google.golang.org/grpc v1.14.0
   2019-01-25T16:56:53.09-0500 [STG/0] ERR go: finding google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8
   2019-01-25T16:56:53.12-0500 [STG/0] ERR go: finding github.com/gliderlabs/ssh v0.1.1
   2019-01-25T16:56:53.16-0500 [STG/0] ERR go: finding github.com/google/martian v2.1.0+incompatible
   2019-01-25T16:56:53.21-0500 [STG/0] ERR go: finding github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910
   2019-01-25T16:56:53.54-0500 [STG/0] ERR go: finding github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07
   2019-01-25T16:56:53.63-0500 [STG/0] ERR go: finding golang.org/x/net v0.0.0-20180724234803-3673e40ba225
   2019-01-25T16:56:53.68-0500 [STG/0] ERR go: finding github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273
   2019-01-25T16:56:56.07-0500 [STG/0] ERR go: finding github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82
   2019-01-25T16:56:56.30-0500 [STG/0] ERR go: finding golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2
   2019-01-25T16:56:57.38-0500 [STG/0] ERR go: finding golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52
   2019-01-25T16:56:57.51-0500 [STG/0] ERR go: finding golang.org/x/lint v0.0.0-20180702182130-06c8688daad7
   2019-01-25T16:57:05.34-0500 [STG/0] ERR go: downloading github.com/cloudfoundry/libbuildpack v0.0.0-20190115190946-c10a4cd29881
   2019-01-25T16:57:05.62-0500 [STG/0] ERR go: downloading github.com/Masterminds/semver v1.4.2
   2019-01-25T16:57:05.63-0500 [STG/0] ERR go: downloading gopkg.in/yaml.v2 v2.2.2
   2019-01-25T16:57:05.63-0500 [STG/0] ERR go: downloading github.com/blang/semver v3.5.1+incompatible
   2019-01-25T16:57:19.48-0500 [STG/0] OUT -----> Nginx Buildpack version 1.0.6
   2019-01-25T16:57:19.48-0500 [STG/0] OUT -----> Supplying nginx
   2019-01-25T16:57:19.48-0500 [STG/0] OUT -----> Requested nginx version: mainline => 1.15.8
   2019-01-25T16:57:19.48-0500 [STG/0] OUT -----> Installing nginx 1.15.8
   2019-01-25T16:57:19.48-0500 [STG/0] OUT        Copy [/tmp/cache/final/dependencies/9541b19f83e98c50d4c3536e45fd70df78e54cf11debb02e34cae434fd1af4aa/nginx-1.15.8-linux-x64-cflinuxfs2-a17501d0.tgz]
   2019-01-25T16:57:19.75-0500 [STG/0] OUT -----> Running go build finalize
   2019-01-25T16:57:19.75-0500 [STG/0] OUT /tmp/buildpackdownloads/adf6125a52c1a65c9523985b5a87ec38 ~
   2019-01-25T16:57:21.27-0500 [STG/0] OUT ~
   2019-01-25T16:57:23.67-0500 [STG/0] OUT Exit status 0

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

IMPORTANT NOTICE: [nginx-buildpack] End of support for cflinuxfs2 on all new dependency version lines

This notice is regarding the end of support for cflinuxfs2 and how it affects all buildpacks and dependencies contained within them.

cflinuxfs2 (based on Ubuntu 14.04) is no longer receiving security updates due to the end of upstream support. As we desire to ensure that buildpacks are always shipped with the latest security patch updates, all new dependency version lines within buildpacks will only be shipped with cflinuxfs3.

We understand that migrating applications over to cflinuxfs3 can take some time. Because of that, existing dependency version lines that support cflinuxfs2 will continue to receive patch updates for both cflinuxfs2 and cflinuxfs3.

Warning: It is not safe to run applications on cflinuxfs2. While buildpacks will still contain dependencies supported on cflinuxfs2, we do not recommend that they be used due to the absence of security updates for cflinuxfs2.

Additionally, a secondary notice will be coming in the near future explaining the timeline for ending cflinuxfs2 supported buildpacks.

IMPORTANT NOTICE: End of support for cflinuxfs2 buildpacks after 2019-08-31

This notice is regarding the end of support for cflinuxfs2 buildpacks after 2019-08-31. As previously mentioned, Ubuntu has ended support for 14.04, and with that, support for cflinuxfs2 has also ended. Due to the need to migrate all applications from cflinuxfs2 to cflinuxfs3, we have continued to release cflinuxfs2 buildpacks while those migrations came to a conclusion. After August 31, 2019, all buildpack releases will be for cflinuxfs3 only.

If you are still in need of migrating your applications over to cflinuxfs3, the Stack Auditor tool can be of use.

lua package install

Is there a standard way of installing lua packages with opm in the buildpack when using the openresty distribution?

{{nameservers}} not working in nginx.conf

  • What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?
cf curl /v2/info && cf version
{
   "name": "xxx",
   "build": "",
   "support": "",
   "version": 0,
   "description": "",
   "authorization_endpoint": "https://xxx",
   "token_endpoint": "https://xxx",
   "min_cli_version": null,
   "min_recommended_cli_version": null,
   "app_ssh_endpoint": "xxx:2210",
   "app_ssh_host_key_fingerprint": "xxx",
   "app_ssh_oauth_client": "ssh-proxy",
   "doppler_logging_endpoint": "wss://doppler.xxx:443",
   "api_version": "2.141.0",
   "osbapi_version": "2.15",
   "routing_endpoint": "https://api.xxx/routing",
   "user": "xxx"
}
cf version 6.47.2+d526c2cb3.2019-11-05
  • What version of the buildpack you are using?

nginx_buildpack_v1_1_3

  • If you were attempting to accomplish a task, what was it you were attempting to do?

I want to push an application with the nameserver injected by cf as described here : {{nameservers}} - support for CF internal domain resolver

My code in nginx.conf is :

http {
  resolver {{nameservers}};
}
  • What did you expect to happen?

I expect the dns servers to be extracted from /etc/resolv.conf and injected in the nginx.conf file. It would then become :

http {
  resolver 169.254.0.2;
}
  • What was the actual behavior?

The application is not pushed and the following error occurs :

   -----> Supplying nginx
   -----> Requested nginx version: mainline => 1.17.7
   -----> Installing nginx 1.17.7
          Copy [/tmp/buildpacks/1773a27b0739b86b0235a214427fbd94/dependencies/502c9539995224def16e6d4673147ac1/nginx-1.17.7-linux-x64-cflinuxfs3-718363fe.tgz]
          **ERROR** Could not write tmp config file: template: conf:35:13: executing "conf" at <nameservers>: wrong number of args for nameservers: want 1 got 0
          **ERROR** Could not validate nginx.conf: template: conf:35:13: executing "conf" at <nameservers>: wrong number of args for nameservers: want 1 got 0
   Failed to compile droplet: Failed to run all supply scripts: exit status 14
   Exit status 223

As far as I understand, the issue comes from the file src/nginx/supply/supply.go, line 266 :

"nameservers": func(arg string) string

instead of

"nameservers": func() string

as specified in file src/nginx/varify/varify.go, line 92 :

"nameservers": func() string

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

NOTICE: End of support for Nginx versions 1.14.x after 2019-05-30

The first release of the Nginx buildpack after May 30, 2019 will no longer include any versions of Nginx 1.14.x. Please migrate your Nginx apps to supported versions of Nginx before that time.

Note: Unless you are manually specifying a version of Nginx for the buildpack to use, or you have customized your Nginx buildpack, no action is required.

Feature Request: Add built-in Perl module

Hi folks,

We could use some scripting capabilities in our NGINX proxy app. I know it is possible to upload custom modules by ourselves. But it is kind of inconvenient, because you need to compile it with the corresponding NGINX version. And I think this module has a wide usage and could be also useful for other consumers.
Unfortunately I don't see a way to create a pull request for this, as the modules are delivered as binary and served from https://buildpacks.cloudfoundry.org/dependencies/nginx/

I suggest to build and deliver http://nginx.org/en/docs/http/ngx_http_perl_module.html as built-in module, as it is the most common one. But any scripting module would do.

reg.
Sascha

IMPORTANT NOTICE: [nginx-buildpack] Change of default nginx version after 2021-07-09

The default version for NGINX will be updated to 1.21.x in the first release of the NGINX buildpack after 2021-07-09.

We are giving a 30 day notice to inform users that the default version of NGINX in the NGINX buildpack will be updated to the latest 1.21.x version in the first release of the NGINX buildpack after 2021-07-09.

If you’d like to use a different NGINX version, please configure your application to select that version.[1]

As always, the buildpacks team is happy to answer questions you may have about this deprecation in the #buildpacks Slack channel[2].

[1] - https://docs.cloudfoundry.org/buildpacks/nginx/index.html
[2] - https://cloudfoundry.slack.com/archives/C02HWMDUQ

Thanks,
The Buildpacks Team

IMPORTANT NOTICE: [nginx-buildpack] End of Support for NGINX versions 1.17.x after 2020-08-07

The first release of the NGINX buildpack after 2020-08-07 will no longer include NGINX versions 1.17.x. These NGINX versions will no longer be supported upstream[1]. Please migrate your NGINX apps to supported versions of NGINX before that time.

Note: As 1.17.x is the current default version of NGINX in the buildpack, the default NGINX version will be updated to 1.19.x as a part of this removal. If you’d like to use a different NGINX version, please configure your application to select that version[2].

As always, the buildpacks team is happy to answer questions you may have about this deprecation in the #buildpacks Slack channel[3].

[1] - https://nginx.org/en/download.html
[2] - https://docs.cloudfoundry.org/buildpacks/nginx/index.html
[3] - https://cloudfoundry.slack.com/archives/C02HWMDUQ

Thanks,
Kashyap Vedurmudi, Buildpacks PM

IMPORTANT NOTICE: [nginx-buildpack] End of Support for NGINX versions 1.18.x and 1.19.x after 2021-07-05

The first release of the NGINX buildpack after 2021-07-05 will no longer include NGINX versions 1.18.x and 1.19.x. These NGINX versions will no longer be supported upstream[1]. Please migrate your NGINX apps to supported versions of NGINX before that time.

Note: As 1.19.x is the current default version of NGINX in the buildpack, the default NGINX version will be updated to 1.20.x as a part of this removal. If you’d like to use a different NGINX version, please configure your application to select that version[2].

As always, the buildpacks team is happy to answer questions you may have about this deprecation in the #buildpacks Slack channel[3].

[1] - https://nginx.org/en/download.html
[2] - https://docs.cloudfoundry.org/buildpacks/nginx/index.html
[3] - https://cloudfoundry.slack.com/archives/C02HWMDUQ

Thanks,
The Buildpacks Team

Feature Request: --with-http_image_filter_module

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?
cli "6.23.0"
cf version 6.45.0+5f9ff16f9.2019-06-03

What version of the buildpack you are using?
nginx_buildpack-cached-cflinuxfs3-v1.1.1.zip

If you were attempting to accomplish a task, what was it you were attempting to do?
utilize https://nginx.org/en/docs/http/ngx_http_image_filter_module.html#image_filter

What did you expect to happen?
able to use module {{module "http_image_filter_module"}} at the top of nginx.conf

What was the actual behavior?
not found

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction
10:45:32 Downloaded app package (210.4K)
10:45:32 -----> Nginx Buildpack version 1.1.1
10:45:32 -----> Supplying nginx
10:45:32 -----> Requested nginx version: mainline => 1.17.5
10:45:32 -----> Installing nginx 1.17.5
10:45:32        Copy [/tmp/buildpacks/xxxxxxxx/dependencies/xxxxxxx/nginx-1.17.5-linux-x64-cflinuxfs3-fa554ae5.tgz]
10:45:32 2020/02/11 15:45:32 [emerg] 39#0: dlopen() "/tmp/xxxxxx/modules/ngx_http_image_filter_module.so" failed (/tmp/xxxxxx/modules/ngx_http_image_filter_module.so: cannot open shared object file: No such file or directory) in /tmp/xxxxxx/nginx.conf:1
10:45:32 nginx: configuration file /tmp/xxxxxx/nginx.conf test failed
10:45:32        �[31;1m**ERROR**�[0m Could not validate nginx.conf: nginx.conf contains syntax errors: exit status 1
10:45:32 Failed to compile droplet: Failed to run all supply scripts: exit status 14
10:45:32 Exit status 223

Environment variables value escaped

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?

{
"name": "",
"build": "",
"version": 0,
"min_cli_version": "6.42.0",
"min_recommended_cli_version": "latest",
"api_version": "2.128.0",
"osbapi_version": "2.14",
}
cf version 6.44.0+5de0f0d02.2019-05-01

What version of the buildpack you are using?

1.0.12

If you were attempting to accomplish a task, what was it you were attempting to do?

Replace environment variables in nginx.conf and return it.
Here is the config 👍

     # configuration endpoint
    location /test {
      default_type application/json;

      set $override "{{env "OVERRIDE"}}";

      if ($override != '') {
          return 200 "{{env "OVERRIDE"}}";
      }

      try_files $uri /assets/test.json last;
    }

What did you expect to happen?

correct value to be returned : { "abcd": 12345 }{ 'ef': "ab" }

What was the actual behavior?

html escaped value : { &#34;abcd&#34;: 12345 }{ &#39;ef&#39;: &#34;ab&#34; }

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

Thank you

Problem with environment variables in nginx.conf

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?
"min_cli_version": "6.23.0",
"min_recommended_cli_version": "6.23.0",
"api_version": "2.98.0",
cf version 6.33.1+c77e55743.2017-12-15

What version of the buildpack you are using?
Nginx Buildpack version 1.0.0

If you were attempting to accomplish a task, what was it you were attempting to do?
Tried to create a generic nginx.conf that does a proxy_pass depending on the environment.

We know that this works in nginx.conf:

        location /api {
            proxy_pass https://delivery-tracker-service-dev.apps-np.homedepot.com;
        }

Based on the documentation we expected this to work:

        location /api {
            proxy_pass https://delivery-tracker-service{{env "SPACE"}}.apps{{env "ZONE"}}.homedepot.com;
        }

with that in the manifest.yml:

  env:
    ZONE: -np
    SPACE: -dev

However, we just got an error message when doing a cf push:

-----> Download go 1.9.1
Failed to compile droplet: Failed to run all supply scripts: exit status 56
Exit status 223

Can we provide the nginx that compiled with --with-compat?

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?

api version:    2.82.0

What version of the buildpack you are using?

1.0 release

If you were attempting to accomplish a task, what was it you were attempting to do?

the nginx config:

load_module ngx_http_sticky_module.so;

logs:

   Installing nginx 1.15.1 Copy [/tmp/buildpacks/7f788470eaeb01f14116979c44aca71a/dependencies/1b46fe5e44de44070849a0d8e5c44c4d/nginx-1.15.1-linux-x64-e81efce1.tgz]
   2018/07/25 11:57:58 [emerg] 23#0: module "/tmp/conf606264057/ngx_http_sticky_module.so" is not binary compatible in /tmp/conf606264057/nginx.conf:1
   nginx: configuration file /tmp/conf606264057/nginx.conf test failed

What did you expect to happen?

  1. nginx can load user provider dynamic module, and nginx itself should also be compiled with --with-compat option

What was the actual behavior?

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

Read environment variables provided in manifest.yml in angular app

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?
6.32

What version of the buildpack you are using?
Cflinux s3-v1.5.6

If you were attempting to accomplish a task, what was it you were attempting to do?
Try to reading environment variables mentioned in the manifest.yml from an angular app.
I dont see any proper documentation to achieve this pcf

What did you expect to happen?
Read environment variables just like java buildpacks

What was the actual behavior?
I dont know whether this is supported by static buildpack or not

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

Openresty LUA_CPATH not set when attempting to using Lua cjson library

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?

Cloud Foundry Version: 2.7.20-build.6
CF CLI Version: 6.47.2+d526c2cb3.2019-11-05

What version of the buildpack you are using?
v1.1.13

If you were attempting to accomplish a task, what was it you were attempting to do?
Using the Openresty distribution I was attempting to use cjson to parse the value of the VCAP_SERVICES environment variable to set a value in my nginx.conf

What did you expect to happen?
Within the set_by_lua_block when calling local cjson = require("cjson") I expect to run without errors

What was the actual behavior?
Error is thrown when attempt to access any URL.

 2020-08-13T18:21:46.25-0400 [APP/PROC/WEB/0] ERR 2020/08/13 22:21:46 [error] 83#0: *5 failed to run set_by_lua*: set_by_lua:2: module 'cjson' not found:
 2020-08-13T18:21:46.25-0400 [APP/PROC/WEB/0] ERR 	no field package.preload['cjson']
 2020-08-13T18:21:46.25-0400 [APP/PROC/WEB/0] ERR 	no file '/tmp/d20200716-7-pqu0r5/openresty/site/lualib/cjson.ljbc'
 2020-08-13T18:21:46.25-0400 [APP/PROC/WEB/0] ERR 	no file '/tmp/d20200716-7-pqu0r5/openresty/site/lualib/cjson/init.ljbc'
 2020-08-13T18:21:46.25-0400 [APP/PROC/WEB/0] ERR 	no file '/tmp/d20200716-7-pqu0r5/openresty/lualib/cjson.ljbc'
 2020-08-13T18:21:46.25-0400 [APP/PROC/WEB/0] ERR 	no file '/tmp/d20200716-7-pqu0r5/openresty/lualib/cjson/init.ljbc'
 2020-08-13T18:21:46.25-0400 [APP/PROC/WEB/0] ERR 	no file '/tmp/d20200716-7-pqu0r5/openresty/site/lualib/cjson.lua'
 2020-08-13T18:21:46.25-0400 [APP/PROC/WEB/0] ERR 	no file '/tmp/d20200716-7-pqu0r5/openresty/site/lualib/cjson/init.lua'
 2020-08-13T18:21:46.25-0400 [APP/PROC/WEB/0] ERR 	no file '/tmp/d20200716-7-pqu0r5/openresty/lualib/cjson.lua'
 2020-08-13T18:21:46.25-0400 [APP/PROC/WEB/0] ERR 	no file '/tmp/d20200716-7-pqu0r5/openresty/lualib/cjson/init.lua'
 2020-08-13T18:21:46.25-0400 [APP/PROC/WEB/0] ERR 	no file '/home/vcap/deps/0/nginx/lualib/cjson.lua'
 2020-08-13T18:21:46.25-0400 [APP/PROC/WEB/0] ERR 	no file '/tmp/d20200716-7-pqu0r5/openresty/site/lualib/cjson.so'
 2020-08-13T18:21:46.25-0400 [APP/PROC/WEB/0] ERR 	no file '/tmp/d20200716-7-pqu0r5/openresty/lualib/cjson.so'
 2020-08-13T18:21:46.25-0400 [APP/PROC/WEB/0] ERR 	no file './cjson.so'
 2020-08-13T18:21:46.25-0400 [APP/PROC/WEB/0] ERR 	no file '/usr/local/lib/lua/5.1/cjson.so'
 2020-08-13T18:21:46.25-0400 [APP/PROC/WEB/0] ERR 	no file '/tmp/d20200716-7-pqu0r5/openresty/luajit/lib/lua/5.1/cjson.so'
 2020-08-13T18:21:46.25-0400 [APP/PROC/WEB/0] ERR 	no file '/usr/local/lib/lua/5.1/loadall.so'
 2020-08-13T18:21:46.25-0400 [APP/PROC/WEB/0] ERR stack traceback:
 2020-08-13T18:21:46.25-0400 [APP/PROC/WEB/0] ERR 	[C]: in function 'require'
 2020-08-13T18:21:46.25-0400 [APP/PROC/WEB/0] ERR 	set_by_lua:2: in main chunk, client: 10.254.66.6, server: localhost, request: "OPTIONS /cloudfoundryapplication HTTP/1.1", host: "my-openresty-app.company.com"

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

deployed application not working properly with optimized build

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?

after optimize for prod and deploy angular 8 application . CSS were completely messed up . w/o optimization working fine
What version of the buildpack you are using?
using:
https://github.com/cloudfoundry/nginx-buildpack.git

If you were attempting to accomplish a task, what was it you were attempting to do?

What did you expect to happen?

What was the actual behavior?

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

Create BOSH release

As a Cloud Foundry operator, I want to include the nginx buildpack along with the other system buildpacks. I see that this repo includes buildpack archives along with releases, but other system buildpacks are distributed as bosh releases via bosh.io. Would you be open to distributing this as a bosh release as well?

Using ngx_http_realip_module seems not to work out-of-the-box

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?
2.141.0
6.47.2+d526c2cb3.2019-11-05

What version of the buildpack you are using?
1.1.1

If you were attempting to accomplish a task, what was it you were attempting to do?
Filter IP addresses based on XFF header. Therefore, using the ngx_http_realip_module module.

What did you expect to happen?
The docs state I should be able to simply insert the module name for built-in modules without including the necessary .so files: https://docs.cloudfoundry.org/buildpacks/nginx/index.html#loading-modules
Reading the NginxRecipe, I see it is built with --with-http_realip_module.

I cloned this repo, used the fixtures/mainline example and just added this first line to the nginx.conf:

{{module "ngx_http_realip_module"}}

Unfortunately, the necessary file isn't found upon pushing the app.

What was the actual behavior?

$ cf push my-app
Pushing app my-app to org <org> / space <space> as <user>...
Getting app info...
Updating app with these attributes...
  name:                my-app
  path:                /home/<user>/nginx-buildpack/fixtures/mainline
  buildpacks:
    https://github.com/cloudfoundry/nginx-buildpack.git
  disk quota:          1G
  health check type:   port
  instances:           1
  memory:              1G
  stack:               cflinuxfs3
  routes:
     <omitted>

Updating app my-app...
Mapping routes...
Comparing local files to remote cache...
Packaging files to upload...
Uploading files...
 1.93 KiB / 1.93 KiB [==================================================================================] 100.00% 1s

Waiting for API to complete processing files...

Staging app and tracing logs...
   Cell 2d48f679-2212-4203-bb7b-61989d4a1853 creating container for instance dcbcfb87-be2e-45d2-a9d1-e397ab4161a5
   Cell 2d48f679-2212-4203-bb7b-61989d4a1853 successfully created container for instance dcbcfb87-be2e-45d2-a9d1-e397ab4161a5
   Downloading app package...
   Downloading build artifacts cache...
   Downloaded app package (1.7K)
   Downloaded build artifacts cache (2.3M)
   -----> Download go 1.12.4
   -----> Running go build supply
   /tmp/buildpackdownloads/adf6125a52c1a65c9523985b5a87ec38 ~
   -----> Nginx Buildpack version 1.1.1
   -----> Supplying nginx
   -----> Requested nginx version: mainline => 1.17.5
   -----> Installing nginx 1.17.5
          Copy [/tmp/cache/final/dependencies/a0ecd9f6b3ef6c7696ea543219c8f52882755c93e7c4e6c58d2283887c4eecc8/nginx-1.17.5-linux-x64-cflinuxfs3-fa554ae5.tgz]
   2019/11/18 06:42:19 [emerg] 431#0: dlopen() "/tmp/contents040357720/deps/0/nginx/nginx/modules/ngx_http_realip_module.so" failed (/tmp/contents040357720/deps/0/nginx/nginx/modules/ngx_http_realip_module.so: cannot open shared object file: No such file or directory) in /tmp/conf656370157/nginx.conf:1
   nginx: configuration file /tmp/conf656370157/nginx.conf test failed
          **ERROR** Could not validate nginx.conf: nginx.conf contains syntax errors: exit status 1
   Failed to compile droplet: Failed to run all supply scripts: exit status 14
   Exit status 223
   Cell 2d48f679-2212-4203-bb7b-61989d4a1853 stopping instance dcbcfb87-be2e-45d2-a9d1-e397ab4161a5
   Cell 2d48f679-2212-4203-bb7b-61989d4a1853 destroying container for instance dcbcfb87-be2e-45d2-a9d1-e397ab4161a5
   Cell 2d48f679-2212-4203-bb7b-61989d4a1853 successfully destroyed container for instance dcbcfb87-be2e-45d2-a9d1-e397ab4161a5
Error staging application: App staging failed in the buildpack compile phase
FAILED

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

If I'm doing something wrong, please point me into the right direction. Thank you very much!

{{port}} replacement also for include files

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?
API-Version: 2.143.0
cf Version 6.46.1

What version of the buildpack you are using?
Nginx Buildpack version 1.1.2

If you were attempting to accomplish a task, what was it you were attempting to do?
I wanted to split the nginx.conf files in some sub-files to get a better structure.
So I include them in the main nginx.conf file with include nginx-conf/*.conf;

What did you expect to happen?
I expect that {{port}} replacement is also working for the included files from the subfolder.

What was the actual behavior?
{{port}} replacement is only done for the nginx.conf file.

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

IMPORTANT NOTICE: End of support for nginx versions 1.18.x and 1.19.x effective immediately

Previously, a 30 day notice was sent alerting users of the nginx buildpack that nginx versions 1.18.x and 1.19.x would be removed in July, 2021. It has been recognized that version lines older than 1.20.x of nginx contain a critical CVE and thus, the affected version lines will be removed in the next release of the nginx buildpack; earlier than previously stated.

Additionally, the default version of nginx will become 1.21.x in the next release. We do not anticipate your application to incur breaking changes, but please be ready to ensure your nginx applications are configured to run with the latest nginx versions.

Thanks,
Buildpacks Team

Provided nginx binary does not include ngx_http_sub_module module compiled.

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?

cf version 6.40.0+07673feb9.2018-10-08

What version of the buildpack you are using?

v1.0.5

If you were attempting to accomplish a task, what was it you were attempting to do?

Try to use sub_filter directive in nginx.conf

What did you expect to happen?

sub_filter directive should be working.

What was the actual behavior?

BP rejects the nginx.conf when linting the configuration file because module is not provided/enabled.

To reproduce try to push any configuration file using the sub_filter directive.

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

Investigate why bot auto-removes version lines

Problem

nginx 1.18 version line was removed by the bot triggered by the pipeline job.

Looking at the history, it seems like the automation auto-removes older minor versions (version lines) when new minors are available, and Core-deps/buildpacks team had to manually re-add it (e.g. re-adding 1.16, re-adding 1.17) after the bot removes them.

This causes buildpack versions to be shipped with versions removed without proper notice if they are not manually noticed and taken action. v1.1.25 removed support for v1.18 version line without due notice.

Investigate

Investigate why the nginx automation/bot removes older version lines when new version lines are added.
Removal of version lines are done manually and automation shouldn't remove version lines.
This issue doesn't seem to be happening in buildpacks like go-buildpack that has similar version lines.

edit: A note about go

Possible typo in sample Nginx.conf specifying stderr pipe.

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?

api_version: 2.144.0
osbapi_version: 2.15
cf version 6.51.0+2acd15650.2020-04-07

What version of the buildpack you are using?

nginx-buildpack-cflinuxfs3-v1.1.1

If you were attempting to accomplish a task, what was it you were attempting to do?

Output Nginx error logs.

What did you expect to happen?

404, 403, 503 etc errors are displayed in the cf logs <application name> --recent output.

What was the actual behavior?

No errors are displayed in the cf logs output.

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

What do you think is the issue?

The sample https://github.com/cloudfoundry/nginx-buildpack/blob/master/fixtures/mainline/nginx.conf file requests that errors be sent to stderr when they should instead be sent to /dev/stderr.

What we cannot determine is whether this is a typo in the sample file, or if there's an adjustment that needs to be made elsewhere in order to allow the Nginx configuration file to redirect to stderr sans directory prefix?

Enable removing all Server header information

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?

2.161.0
cf version 7.2.0+be4a5ce2b.2020-12-10

What version of the buildpack you are using?

v1.17.10

If you were attempting to accomplish a task, what was it you were attempting to do?

Completely remove Server information from the response.

What did you expect to happen?

Expect to be able to do so natively in with the buildpack.
Removing all header information relating to the nginx installation requires compiling the ngx_http_header_filter_module or use of third-party modules, namely nginx-module-security-headers or, nginx-module- headers-more, neither of which are statically compiled as per https://docs.cloudfoundry.org/buildpacks/nginx/index.html#loading-modules

What was the actual behavior?

Noop

NGINX buildpack and DNS

By default NGINX resolves DNS for upstream hosts only once (on start) which is not always suitable. Using staticfile buildpack it was possible to make NGINX use system dns using the following "hack":

  <% RESOLVERS = ( require 'resolv'; Resolv::DNS::Config.default_config_hash[:nameserver].join(" ") ) %>
  resolver <%= RESOLVERS %> ipv6=off; # unused if backends are specified as IPs

It seems to be impossible to do the same with nginx-buildpack. Any suggestions?

IMPORTANT NOTICE: [nginx-buildpack] End of Support for NGINX versions 1.16.x after 2020-06-07

The first release of the NGINX buildpack after 2020-06-07 will no longer include NGINX versions 1.16.x. These NGINX versions will no longer be supported upstream[1]. Please migrate your NGINX apps to supported versions of NGINX before that time.

Note: As 1.16.x is the current stable version of NGINX in the buildpack, the stable NGINX version will be updated to 1.18.x as a part of this removal. If you’d like to use a different NGINX version, please configure your application to select that version[2].

As always, the buildpacks team is happy to answer questions you may have about this deprecation in the #buildpacks Slack channel[3].

[1] - https://nginx.org/en/download.html
[2] - https://docs.cloudfoundry.org/buildpacks/nginx/index.html
[3] - https://cloudfoundry.slack.com/archives/C02HWMDUQ

Thanks,
Kashyap Vedurmudi, Buildpacks PM

Release notes for v1.0.0 suggest you can use {{ port }} with spaces, but you can't

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?

N/A

What version of the buildpack you are using?

v1.0.0 or above

If you were attempting to accomplish a task, what was it you were attempting to do?

Following the release notes to update from v0.0.5 to v1.0.3, I replaced {{.Port}} with {{ port }} in my nginx.conf

What did you expect to happen?

I expected the build to work

What was the actual behavior?

The build failed with:

          **ERROR** nginx.conf file must be configured to respect the value of `{{port}}`
          **ERROR** Could not validate nginx.conf: no {{port}} in nginx.conf
   Failed to compile droplet: Failed to run all supply scripts: exit status 14

The validator expects the string {{port}} with no spaces inside the curly braces.

Either the release notes should be updated to use {{port}} or the validator should be updated to allow optional spaces (if this would be templated correctly)

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

Please configure GITBOT

Pivotal provides the Gitbot service to synchronize issues and pull requests made against public GitHub repos with Pivotal Tracker projects.

If you are a Pivotal employee, you can configure Gitbot to sync your GitHub repo to your Pivotal Tracker project with a pull request.

Steps:

  • Fork this repo: cfgitbot-config (an ask+cf@ ticket is the fastest way to get read access if you get a 404)
  • Add the Toolsmiths-Bots team to have admin access to your repo
  • Add the cf-gitbot ([email protected]) user to have owner access to your Pivotal Tracker project
  • Add your new repo and or project to config-production.yml file
  • Submit a PR, which will get auto-merged if you've done it right

If you are not a pivotal employee, you can request that [email protected] set up the integration for you.

You might also be interested in configuring GitHub's Service Hook for Tracker on your repo so you can link your commits to Tracker stories. You can do this yourself by following the directions at:

https://www.pivotaltracker.com/blog/guide-githubs-service-hook-tracker/

If you do not want to use Pivotal Tracker to manage this GitHub repo, Please add this repo to the Ignored repositories list

If there are any questions, please reach out to [email protected].

NewRelic Integration

As the slack channel is archived, I'm using this as a way to ask whether a PR with NewRelic Integration would be welcome?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.