M
M
maximkalga2017-01-23 17:51:48
Django
maximkalga, 2017-01-23 17:51:48

How to raise one of the Django applications on a project subdomain (nginx)?

There are two applications in the project - landing and dashboard.
The landing should be on the example.com domain, and the personal account and everything else on the dashboard.example.com subdomain. Tell me how to configure Nginx in this case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Peter, 2017-01-23
@maximkalga

So what's so difficult?
In DNS, you must have 2 domains example.com and dashboard.example.com registered. In your case, they refer to the same IP.
Then in nginx you register 2 virtual servers:

server {
    listen 80;
    server_name example.com;
    root <путь к статическому контенту>/static_content;
}

and
server {
    listen 80;
    server_name dashboard.example.com;
    root <путь к статическому контенту>/static_content;
}

And everywhere proxying to the upstream of each of your django applications.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question