nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument

That warning with the nginx.pid file is a know bug (at least for Ubutnu if not for other distros as well). More details here: https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/1581864 Workaround (on a ssh console, as root, use the commands bellow): mkdir /etc/systemd/system/nginx.service.d printf “[Service]\nExecStartPost=/bin/sleep 0.1\n” > /etc/systemd/system/nginx.service.d/override.conf systemctl daemon-reload systemctl restart nginx Then check if you still see that … Read more

Nginx timeouts when uWSGI takes long to process request

The configuration that solves the problem is: location / { include uwsgi_params; uwsgi_pass 127.0.0.1:9001; uwsgi_read_timeout 300; index index.html index.htm; } The reason the above configuration in the question did not work for us because unfortunately in our machine multiple paths had nginx.conf file. We were working with the conf at the wrong path. To correctly … Read more

Internal Server Error with Django and uWSGI

I have solved this in my original command line did not include full path to the wsgi.py file to run uWSGI uwsgi –http :8000 –chdir /srv/www/databankinfo.com/projectdatabank/ –wsgi-file wsgi.py to this uwsgi –http :8000 –chdir /srv/www/databankinfo.com/projectdatabank/ –wsgi-file full/path/wsgi.py and it worked

uWSGI, Flask, sqlalchemy, and postgres: SSL error: decryption failed or bad record mac

The issue ended up being uwsgi’s forking. When working with multiple processes with a master process, uwsgi initializes the application in the master process and then copies the application over to each worker process. The problem is if you open a database connection when initializing your application, you then have multiple processes sharing the same … Read more

uWSGI request timeout in Python

You’re propably looking for the harakiri parameter – if request takes longer than specified harakiri time (in seconds), the request will be dropped and the corresponding worker recycled. For standalone uwsgi (ini config): [uwsgi] http = 0.0.0.0:80 harakiri = 30 … If you have nginx proxy before uwsgi you have to increase timeout as well: … Read more

Nginx error: (13: Permission denied) while connecting to upstream

The permission issue occurs because uwsgi resets the ownership and permissions of /tmp/uwsgi.sock to 755 and the user running uwsgi every time uwsgi starts. The correct way to solve the problem is to make uwsgi change the ownership and/or permission of /tmp/uwsgi.sock such that nginx can write to this socket. Therefore, there are three possible … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)