Question
Nginx connect() failed (111: Connection refused) while connecting to upstream
Hi
I have the following error in the log
2019/07/11 01:33:38 [error] 31488#31488: *6 connect() failed (111: Connection refused) while connecting to upstream, client: 186.6.129.22, server: 127.0.0.1, request: “GET /favicon.ico HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “myexample.com:8081”, referrer: “https://myexample.com:8081/”
When I execute nginx -t show me
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
The configuration that I have is
server {
server_name 127.0.0.1;
root /var/www/html/moodle;
index index.php;
location / {
try_files $uri /index.php?$query_string;
}
location /dataroot/ {
internal;
alias /var/moodledata/;
}
location ~ [^/]\.php(/|$){
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
Nginx works well for me when in the configuration disable
root /var/www/html/moodle;
index index.php;
Although what I want is to install moodle 3.6
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×