Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

531
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!