Code Monkey home page Code Monkey logo

Comments (9)

itsafire avatar itsafire commented on May 21, 2024

The added code to the server section in nginx.tmpl:

    {{ $firstContainer := index $containers 0 }}
    {{ if $firstContainer.Env.VIRTUAL_ALLOW }}
        {{ range $i, $allowed := split $firstContainer.Env.VIRTUAL_ALLOW "," }}
            allow {{ $allowed }};
        {{ end }}
        deny all;
    {{ end }}

from nginx-proxy.

md5 avatar md5 commented on May 21, 2024

I believe this can be closed since #106 was merged. See the README for instructions: https://github.com/jwilder/nginx-proxy/blob/master/README.md#custom-nginx-configuration

from nginx-proxy.

moul avatar moul commented on May 21, 2024

Hi, even if #106 lets us do the equivalent of this PR,

I think this PR is a better solution when you want to handle all the configuration from the proxyfied container with environment variables.
It's a little by annoying to put some configuration in the proxyfied container and update a file on the host.
particularly when you use nginx-proxy as the host nginx and want to just handle new containers without thinking about it

What do you think about keeping #106 to handle every cases, and use this PR as an additional method ?

from nginx-proxy.

aimxhaisse avatar aimxhaisse commented on May 21, 2024

👍

from nginx-proxy.

tpiron avatar tpiron commented on May 21, 2024

👍

from nginx-proxy.

md5 avatar md5 commented on May 21, 2024

@moul You guys might want to check out the discussion in #134. Two possible options discussed there are a JSON-formatted VIRTUAL_HOST_CONFIG variable or a naming convention for variables starting with NGINX_PROXY_* to expose any (or perhaps just most) Nginx settings.

from nginx-proxy.

thaJeztah avatar thaJeztah commented on May 21, 2024

Perhaps labels are an option too; e.g. org.jsonwilder.nginx-proxy.something=val

from nginx-proxy.

md5 avatar md5 commented on May 21, 2024

@thaJeztah Thanks for the reminder about labels. I haven't gotten around to playing with them yet, unfortunately.

Looks like label support was added to go-dockerclient here: fsouza/go-dockerclient@bd32742

from nginx-proxy.

md5 avatar md5 commented on May 21, 2024

This is relevant too: nginx-proxy/docker-gen#81

from nginx-proxy.

Related Issues (20)

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.