Hi everyone, sorry for this post, it seems common enough but I have looked and the answers are varied and don't seem to match my install.
It a fresh Centos 7.4, I have followed the install guide. And then found the missing parts for the nginx config + others here:
I can run the dev model, from the guide like this: "python3 manage.py runserver
0.0.0.0:8000 --insecure" this part works fine, no problems.
But yeah I am still stuck @ a '502 Bad Gateway' and am really not sure where to start troubleshooting. SElinux is disabled. HTTP, HTTPS + 8000/tcp allowed.
I don't think unicorn is running:
ps aux | grep gunicorn
root 2537 0.0 0.0 112704 972 pts/0 R+ 18:05 0:00 grep --color=auto gunicorn
/etc/supervisord.d/netbox.conf
[program:netbox]
command = gunicorn -c /opt/netbox/gunicorn_config.py netbox.wsgi
directory = /opt/netbox/netbox/
user = nginx
/opt/netbox/gunicorn_config.py
command = '/bin/gunicorn'
pythonpath = '/opt/netbox/netbox'
workers = 3
user = 'nginx'
/etc/nginx/conf.d/netbox.conf
server {
listen 80;
client_max_body_size 25m;
location /static/ {
alias /opt/netbox/netbox/static/;
}
location / {
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
}
}
sudo -u nginx gunicorn -c /opt/netbox/gunicorn_config.py netbox.wsgi
[2018-06-07 18:16:38 -0400] [2623] [INFO] Starting gunicorn 19.8.1
[2018-06-07 18:16:38 -0400] [2623] [INFO] Using worker: sync
[2018-06-07 18:16:38 -0400] [2626] [INFO] Booting worker with pid: 2626
[2018-06-07 18:16:38 -0400] [2627] [INFO] Booting worker with pid: 2627
[2018-06-07 18:16:38 -0400] [2628] [INFO] Booting worker with pid: 2628
This seems to stop here and not get any further and results in a 'Bad Request (400)'.
CTRL+C -> Back to a 502 Bad Gateway.
tail -f /var/log/nginx/error.log
I hope there is enough info there to point out something obvious?? Would really appreciate it, thank you so much!!
Ollie