Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6744241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:03:36+00:00 2026-05-26T12:03:36+00:00

i’m trying to setup django on nginx + gunicorn on a centos6 server (firewall

  • 0

i’m trying to setup django on nginx + gunicorn on a centos6 server (firewall off, selinux disabled). the project works locally on the server (tested running gunicorn on 127.0.0.1:8221), but not on the whole network. the project should be accessible from a subdomain project.mydomain.com

the project itself is located on a server centos6.mydomain.com and the dns server is main.mydomain.com

my ngnix conf for the project:

upstream project {
    server 127.0.0.1:8221 fail_timeout=0;
}

server {
    listen 80;
    server_name project.mydomain.com;
    access_log /var/log/nginx/project.mydomain.com.log;
    error_log /var/log/nginx/project.mydomain.com.log;

    root /home/USER/djangosites/project;

    location / {
        proxy_set_header Host $host;
        if (!-f $request_filename){
            proxy_pass http://project;
            break;
        }

        }
    location /media  {
        alias /home/USER/djangosites/project/media;
        }
    location /static  {
        alias /home/USER/djangosites/project/static;
    }
}

nginx conf for the centos6 (working)

server {
        listen 80 default_server;
        server_name centos6.mydomain.com;
        access_log /var/log/nginx/centos6.mydomain.com.access.log main;
        error_log /var/log/nginx/centos6.mydomain.com.error.log;

        location / {
                root /var/www/centos6.mydomain.com;
                index index.html;
        }
}

gunicorn conf

import multiprocessing

bind = "127.0.0.1:8221"
logfile = "/home/USER/djangosites/project/gunicorn.log"
workers = multiprocessing.cpu_count() * 2 + 1

would i be better off giving a new ip (to the outside) to the project that is different from centos6.mydomain.com or i can just use the same ip with different local port?

how should i configure hosts.db on main.mydomain.com then?

centos6   A       xxx.xxx.xxx.220
project   A       xxx.xxx.xxx.221

or

centos6   A       xxx.xxx.xxx.220
project   A       xxx.xxx.xxx.220:8221

or

centos6   A       xxx.xxx.xxx.220
project   CNAME   centos6

i’m kind of more inclined to give a new ip because everything is behind a m0n0wall, so a new ip could perhaps be easier to manage.

so basically, i’m guessing that my nginx conf for the project is flawed. what should i do with it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:03:37+00:00Added an answer on May 26, 2026 at 12:03 pm

    ok. got it working 🙂
    hosts.db on main.mydomain.com

    project   CNAME   centos6
    

    gunicorn runnig on 127.0.0.1:8221
    and edited the nginx conf as stated above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
I am trying to render a haml file in a javascript response like so:
I am trying to loop through a bunch of documents I have to put

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.