Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting 404 after startup #1

Closed
ghost opened this issue Apr 13, 2017 · 12 comments
Closed

Getting 404 after startup #1

ghost opened this issue Apr 13, 2017 · 12 comments

Comments

@ghost
Copy link

ghost commented Apr 13, 2017

Hey,

This is great, just can't seem to get around this issue. After running sudo compose-build up and opening my localhost, I get this error:

web_1      | 2017/04/13 00:16:55 [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: "127.0.0.1"
web_1      | 2017/04/13 00:16:55 [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: "127.0.0.1"
web_1      | 172.17.0.1 - - [13/Apr/2017:00:16:55 +0000] "GET / HTTP/1.1" 404 564 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36"

Any ideas what might be going on?

@colinwilson
Copy link
Member

Try adding:

upstream fastcgi_backend {
    server 127.0.0.1:9000;
}

To the nginx default.conf file.

@ghost ghost closed this as completed Apr 13, 2017
@ghost ghost reopened this Apr 13, 2017
@ghost
Copy link
Author

ghost commented Apr 13, 2017

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

@colinwilson
Copy link
Member

colinwilson commented Apr 13, 2017

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

@ghost
Copy link
Author

ghost commented Apr 13, 2017

"upstream" directive is not allowed here in /etc/nginx/nginx.conf:13

@colinwilson
Copy link
Member

Sorry, did you place it inside the http block?

@ghost
Copy link
Author

ghost commented Apr 13, 2017

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;
}

@colinwilson
Copy link
Member

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

@ghost
Copy link
Author

ghost commented Apr 15, 2017 via email

@ghost
Copy link
Author

ghost commented Apr 15, 2017 via email

@colinwilson
Copy link
Member

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.

@ghost
Copy link
Author

ghost commented Apr 16, 2017 via email

@colinwilson
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant