How to make UWSGI interal routing work?

I have a Django application working with uWSGI. My uWSGI configuration:

[uwsgi]
http = 127.0.0.1:8000
env = DJANGO_SETTINGS_MODULE=my_django_app.settings
module = my_django_app.wsgi:application
home = /var/www/myapp/venv
chdir = /var/www/myapp/app
pidfile = /tmp/myapp.pid
logger = syslog
logfile-chown = True
logfile-chmod = 644
touch-logreopen = /var/www/uwsgi/log/rotate_monitor
uid = myapp
gid = myapp
master = True
vacuum = True
harakiri = 20
max-requests = 5000
processes = 4
threads = 1
post-buffering=4096
touch-reload = /var/www/myapp/conf/uwsgi.ini

route = ^/test log:someone called /test

But the route directive does not work, I get a regular uwsgi log entry. I played a lot around, but I can’t find a way to make it work. Any ideas? My version of uWSGI 2.0.5.1

+4
source share
1 answer

I had to install uWSGI with pcre support. He solved the problem with routing.

To do this, I had to install pcre lib (for Ubuntu, a package called libpcre3) and reinstall uWSGI. Since PCRE is already on your system, uWSGI will be automatically compiled with pcre support.

@tobias.mcnulty, :

  • libpcre3-dev Ubuntu
  • pip install -I --no-cache-dir uwsgi, , .
  • !!! no internal routing support, rebuild with pcre support !!!
+3

Source: https://habr.com/ru/post/1568782/


All Articles