Saturday, May 11, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 6488  / 1 Year ago, thu, february 16, 2023, 9:11:44

Using this deployment tutorial, I'm trying to get an Ubuntu 12.04 server up and running with Flask, uWSGI and Nginx. I now have trouble getting Nginx to run. When I try to (re)start nginx it simply says ...fail!, and when I run a test (using sudo nginx -t), it says:



nginx: [emerg] unknown directive "uwsgi_param" in /etc/nginx/uwsgi_params:1
nginx: configuration file /etc/nginx/nginx.conf test failed


I didn't change anything in that file, so its contents are the default ones:



uwsgi_param     QUERY_STRING            $query_string;
uwsgi_param REQUEST_METHOD $request_method;
uwsgi_param CONTENT_TYPE $content_type;
uwsgi_param CONTENT_LENGTH $content_length;

uwsgi_param REQUEST_URI $request_uri;
uwsgi_param PATH_INFO $document_uri;
uwsgi_param DOCUMENT_ROOT $document_root;
uwsgi_param SERVER_PROTOCOL $server_protocol;
uwsgi_param UWSGI_SCHEME $scheme;

uwsgi_param REMOTE_ADDR $remote_addr;
uwsgi_param REMOTE_PORT $remote_port;
uwsgi_param SERVER_PORT $server_port;
uwsgi_param SERVER_NAME $server_name;


My server definition in /etc/nginx/sites-available/www looks like this:



server {
listen 8080;
server_name myapp;

root /var/www/myapp;
try_files $uri @uwsgi;
location @uwsgi {
include uwsgi_params;
uwsgi_pass unix:/tmp/myapp.sock;
}
}


Does anybody know what I'm doing wrong here? Why doesn't this run? All tips are welcome!


More From » server

 Answers
0

The fix for me was as simple as:



sudo apt-get install nginx-full

[#26870] Friday, February 17, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
heaco

Total Points: 479
Total Questions: 124
Total Answers: 114

Location: Lesotho
Member since Sat, Oct 1, 2022
2 Years ago
;