Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

541
Visualizações
nginx/gunicorn + Django: subdomain configuration for third party application integration

I am building a regular django project - the difference is this:

  1. I want the django website to only "work" on a specified subdomain - for example, http://www.foo.mydomain.com

  2. I want to use an entirely different application to run on another specified subdomain - e.g. http://www.foobar.mydomain.com

How do I setup a django project, so that it only runs on a specific subdomain, and does not intercept requests to other subdomains - so other other applications can run on other subdomains on the same parent domain?

[[Note 1]]

The second application (running on the other subdomain is not a django app). In fact, it's mattermost, that I want to run on the other subdomain - so I can integrate mattermost into my website.

[[Note 2]]

I'm using nginx + gunicorn as the server

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Use a separate server block for each domain. See this document.

server {
    server_name www.foo.mydomain.com;
    ...
}
server {
    server_name www.foobar.mydomain.com;
    ...
}

Where a server_name match cannot be found, nginx will use the default server. So define a catch-all server block to prevent nginx using one of the server blocks above.

server {
    listen 80 default_server;
    deny all;
}
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda