Code Monkey home page Code Monkey logo

Comments (12)

colinwilson avatar colinwilson commented on May 20, 2024

Try adding:

upstream fastcgi_backend {
    server 127.0.0.1:9000;
}

To the nginx default.conf file.

from nginx-php-fpm.

 avatar commented on May 20, 2024

Yeah I saw that in a thread somewhere, but I'm getting this:

"upstream" directive is not allowed here in /etc/nginx/conf.d/default.conf

which shuts nginx down

from nginx-php-fpm.

colinwilson avatar colinwilson commented on May 20, 2024

Try adding it to the /etc/nginx/nginx.conf file instead.

from nginx-php-fpm.

 avatar commented on May 20, 2024
"upstream" directive is not allowed here in /etc/nginx/nginx.conf:13

from nginx-php-fpm.

colinwilson avatar colinwilson commented on May 20, 2024

Sorry, did you place it inside the http block?

from nginx-php-fpm.

 avatar commented on May 20, 2024

No longer getting that error on nginx startup, but its still not able to connect to the php7.0-fpm.sock file

web_1      | 2017/04/13 22:15:42 [crit] 18#18: *1 connect() to unix:/run/php/php7.0-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 172.17.0.1, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "localhost"
web_1      | 2017/04/13 22:15:42 [error] 18#18: *1 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 172.17.0.1, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock", host: "localhost"

Here's the contents of my etc/nginx/nginx.conf file:


user  nginx;
worker_processes 2;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    upstream fastcgi_backend {
       server 127.0.0.1:9000;
    }

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}

from nginx-php-fpm.

colinwilson avatar colinwilson commented on May 20, 2024

Sorry. Quick question, are you in fact trying to use the craftcms-docker repo?

from nginx-php-fpm.

 avatar commented on May 20, 2024

from nginx-php-fpm.

 avatar commented on May 20, 2024

from nginx-php-fpm.

colinwilson avatar colinwilson commented on May 20, 2024

I noticed that you said you ran the sudo compose-build up command, and also that that repo's default.conf is configured for php 7.0.x not php 7.1 which is the image it's pulling.

I'll update it soon.

from nginx-php-fpm.

 avatar commented on May 20, 2024

from nginx-php-fpm.

colinwilson avatar colinwilson commented on May 20, 2024

Cool. I'll close this issue and update the other repo. Will also create a Craft 3 (Beta) branch too.

from nginx-php-fpm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.