Answer the question
In order to leave comments, you need to log in
Django Gunicorn subdomain?
Hello!
I have a site with mysite.ru, everything is spinning using the nginx + gunicorn bundle, the main domain config:
server {
listen 80;
server_name mysite.ru;
access_log /var/log/nginx/example.log;
location ~* ^.+\.(jpg|jpeg|gif|png|ico|txt|css|js)$ {
root /var/www/blog/myblog/;
}
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 81;
server_name test.mysite.ru;
access_log /var/log/nginx/example.log;
location ~* ^.+\.(jpg|jpeg|gif|png|ico|txt|css|js)$ {
root /var/www/testblog/myblog/;
}
location / {
proxy_pass http://127.0.0.1:8001;
proxy_set_header Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question