Removing the port number from URL

Posted by DrewSSP on Stack Overflow See other posts from Stack Overflow or by DrewSSP
Published on 2014-05-28T21:23:15Z Indexed on 2014/05/28 21:25 UTC
Read the original article Hit count: 177

Filed under:
|
|
|
|

I'm new to anything related to servers and am trying to deploy a django application. Today I bought a domain name for the app and am having trouble configuring it so that the base URL does not need the port number at the end of it. I have to type www.trackthecharts.com:8001 to see the website when I only want to use www.trackethecharts.com. I think the problem is somewhere in my nginx, gunicorn or supervisor configuration.

gunicorn_config.py

command = '/opt/myenv/bin/gunicorn'
pythonpath = '/opt/myenv/top-chart-app/'
bind = '162.243.76.202:8001'
workers = 3
root@django-app:~# 

nginx config

server {
    server_name 162.243.76.202;

    access_log off;

    location /static/ {
        alias /opt/myenv/static/;
    }  

    location / {
        proxy_pass http://127.0.0.1:8001;
        proxy_set_header X-Forwarded-Host $server_name;
        proxy_set_header X-Real-IP $remote_addr;
        add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
    }
}

supervisor config

[program:top_chart_gunicorn]
command=/opt/myenv/bin/gunicorn -c /opt/myenv/gunicorn_config.py  djangoTopChartApp.wsgi
autostart=true
autorestart=true
stderr_logfile=/var/log/supervisor_gunicorn.err.log
stdout_logfile=/var/log/supervisor_gunicorn.out.log

Thanks for taking a look.

© Stack Overflow or respective owner

Related posts about python

Related posts about django