Jaehyun Shin
Jaehyun Shin

Reputation: 1602

Can I make heroku multiple web dynos formation and routing by subdomain?

I use heroku web and worker dynos. And now I want to split requests by subdomain or path.

for example

Procfile

web: bundle exec puma -p $PORT ./config/puma
admin-web: bundle exec puma -p $PORT ./config/puma
worker: ...

Is it possible?

Upvotes: 6

Views: 3007

Answers (2)

Maik Hoepfel
Maik Hoepfel

Reputation: 1797

It should be possible by using two Procfiles and the Multi-Procfile Buildpack, one for web, one for admin-web. It's described in detail here.

Upvotes: 1

rdegges
rdegges

Reputation: 33824

No. You cannot do this. Domains are routed to dynos at the Heroku application level.

If you want to do this, you'll need to create two separate Heroku applications -- or, a much simpler idea: have only one type of web server, and parse the incoming URL. If the URL starts with admin., then display content for admins, if the URL starts with www., then display non-admin content =)

Upvotes: 3

Related Questions