GithubHelp home page GithubHelp logo

Comments (8)

josegonzalez avatar josegonzalez commented on June 7, 2024

Unfortunately, there are only two options for this:

  • to use a custom nginx.conf.sigil to perform the mapping
  • deploy two different apps, each one listening on a different port

That said, what would be the desired interface for this? How would it work for apps that aren't mapped to a particular domain?

from dokku.

markokraemer avatar markokraemer commented on June 7, 2024

All right, thanks for getting back! I´ll try out the custom nginx.conf.sigil again.

I think the optimal interface would be to be able to map it via CLI.
So just as I mapping internal to external ports for an app, you could maybe also map an external facing port of the App to an Domain you have added to the app // directly map the internal port to the domain. If an App´s port is not mapped to a domain and is exposed externally, then its just accessible without the port.

from dokku.

josegonzalez avatar josegonzalez commented on June 7, 2024

I mean it would be somehow mapped via the cli, but what do those commands look like in your head?

from dokku.

markokraemer avatar markokraemer commented on June 7, 2024

Maybe something like this would be intuitive
dokku ports:add app-name 80:8080 appname.com

Although I dont know if 'ports' is the propper place to do that management, would rather fit into proxy


For the custom nginx.conf.sigil I am running into the following issue:

When trying to: dokku nginx:set /root/softgen.ai/softgen.ai/template/nginx.conf.sigil project-13 .dokku/nginx.conf.sigil

Returns: ! Invalid key specified, valid keys include: access-log-format, access-log-path, bind-address-ipv4, bind-address-ipv6, client-max-body-size, disable-custom-config, error-log-path, hsts, hsts-include-subdomains, hsts-preload, hsts-max-age, nginx-conf-sigil-path, proxy-read-timeout, proxy-buffer-size, proxy-buffering, proxy-buffers, proxy-busy-buffers-size, x-forwarded-for-value, x-forwarded-port-value, x-forwarded-proto-value, x-forwarded-ssl

I always get it back, even if I leave the nginx.conf.sigil exactly as it is in the template tehttps://github.com/dokku/dokku/blob/master/plugins/nginx-vhosts/templates/nginx.conf.sigil – no matter if edited or not I get that error.

from dokku.

josegonzalez avatar josegonzalez commented on June 7, 2024

The ports:add command already takes multiple port mappings, so your example wouldn't work.


You can't set the path of an nginx.conf.sigil file like that. Not sure where you got that command, but if it was ChatGPT, please try our docs site first...

https://dokku.com/docs/networking/proxies/nginx/?h=nginx.conf.sigil#customizing-the-nginx-configuration

from dokku.

markokraemer avatar markokraemer commented on June 7, 2024

I took the command from the docs directly, ChatGPT would probably have gotten it right – I thought the 'nginx-conf-sigil-path' is a placeholder for the path...

Maybe something in this direction?

  • dokku domains:map

  • dokku domains:map app-name domain.com 80

  • dokku proxy:map

  • dokku proxy:map app-name domain.com 80
    Map a mapped external port of an app to a specific domain.

from dokku.

josegonzalez avatar josegonzalez commented on June 7, 2024

Baring rare exceptions (buildpacks and proxy) the :set commands take property keys, so those aren't placeholders. In this case, the value would be a value in your repo path.

With a domains map command, what is the port 80 there? Is that a host port or a container port? How do we know which mapping to use, and how does this relate to the scheme?

from dokku.

josegonzalez avatar josegonzalez commented on June 7, 2024

I'm going to close it. I don't think I'll be implementing this as the port map construct - as well as proxies implementing them - is already complex enough. While I think it would be useful, I think this would require a rethink on how process, ports, and domains all relate to each other.

from dokku.

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.