0
votes

I am trying to setup graphite with nginx. Because of this I need to run it using a configuration or ini file in /etc/uwsgi, but I am unable to get the application to start correctly.

Using, the command,

uwsgi --http :9090 --wsgi-file /opt/graphite/conf/graphite.py

Graphite starts and runs fine, I can navigate it and look at stats.

I proceeded to create an ini file, with the contents:

[uwsgi]
processes = 2
socket = localhost:8081
gid = nginx
uid = nginx
chdir = /opt/graphite/conf
uswsgi-file = graphite.py

running the ini file I see:

mapped 145536 bytes (142 KB) for 2 cores
*** Operational MODE: preforking ***
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***

I can only guess it something is misconfigured here in the ini file but I am not seeing what it is.

Any help is appreciated!

1

1 Answers

0
votes

There are some differences between your command line and ini file:

  1. you're using socket instead of http inside ini. That means, uWSGI server will talk using uwsgi protocol instead of http. If you're using uwsgi_pass in nginx and trying to access your website from browser through that nginx, it's fine. But if you're trying to access uwsgi directly from browser, bypassing nginx, you won't succeed because browsers doesn't talk uwsgi.

  2. You've put uswgi-file instead of wsgi-file into your config. That won't work at all and uwsgi won't be able to find your wsgi file. And if you're chdiring into directory with your wsgi file, it is better to use:

    module = wsgi
    

    instead of wsgi-file.