blacklabelops-legacy / nginx

Dockerized Ready-To-Go Nginx Reverse Proxy. Let's encrypt Support!
MIT License
95 stars 41 forks source link

Custom reverse proxy headers not generated #11

Closed MrHash closed 7 years ago

MrHash commented 7 years ago

Looking at this line: https://github.com/blacklabelops/nginx/blob/master/imagescripts/reverse_proxy.sh#L91 it looks like there is no ${i} counter so no proxy headers are generated!

blacklabelops commented 7 years ago

Thank you for reporting this problem, I will check the feature shortly.

MrHash commented 7 years ago

Example config is where ${HOST_NAME} is an environment variable honeylex.dev. Tried the quoted technique as given in the docs as well.

    environment:
      NGINX_REDIRECT_PORT80: "true"
      SERVER1SERVER_NAME: ${HOST_NAME}
      SERVER1HTTP_ENABLED: "false"
      SERVER1HTTPS_ENABLED: "true"
      SERVER1REVERSE_PROXY_LOCATION1: /
      SERVER1REVERSE_PROXY_PASS1: http://nginx:8000
      SERVER1PROXY_APPLICATION: custom
      SERVER1REVERSE_PROXY_HEADER1FIELD1: X-Forwarded-Host ${HOST_NAME}
MrHash commented 7 years ago

FYI this style of environment variable setting via docker-compose works for me:

environment:
  ...
  SERVER1REVERSE_PROXY_HEADER1FIELD1: X-Forwarded-For $$proxy_add_x_forwarded_for