404 Not Found with nginx and phpBlank Page: wordpress on nginx+php-fpmTrouble with nginx and serving from...

Why is it "take a leak?"

Achieving MPPT of a solar panel with LM2596

What is this waxed root vegetable?

Is there any relevance to Thor getting his hair cut other than comedic value?

What are all the squawk codes?

Is divide-by-zero a security vulnerability?

How do I deal with being jealous of my own players?

School performs periodic password audits. Is my password compromised?

Are paired adjectives bad style?

How do you say "powers of ten"?

Why do phishing e-mails use faked e-mail addresses instead of the real one?

What does @RC mean in SSDT SQL Server Unit Testing?

Practical reasons to have both a large police force and bounty hunting network?

Are small insurances worth it

The need of reserving one's ability in job interviews

Borrowing Characters

Where is the fallacy here?

Can I become debt free or should I file for bankruptcy? How do I manage my debt and finances?

Is there a frame of reference in which I was born before I was conceived?

Why doesn't Object.keys return a keyof type in TypeScript?

Misplaced tyre lever - alternatives?

Get length of the longest sequence of numbers with the same sign

Do higher etale homotopy groups of spectrum of a field always vanish?

In Adventurer's League, is it possible to keep the Ring of Winter if you manage to acquire it in the Tomb of Annihilation adventure?



404 Not Found with nginx and php


Blank Page: wordpress on nginx+php-fpmTrouble with nginx and serving from multiple directories under the same domainphpmyadmin having problems on nginx and php-fpm on RHEL 6PHP app breaks on Nginx, but works on ApacheNGINX don't parse .php5 as .phpnginx rewrite throw 404 with last and breakCodeIgniter nginx rewrite rules for i8ln URL'sDocker, Nginx and PHP7: ERROR 111 Connection refused while connecting to upstreamHow to configure nginx to serve one site from two different document root and using different php depending on URLNGINX not accessing folder













0















I got inside the browser:



404 Not Found
nginx/1.13.10


and in the logs I got:



$ ls logs/
nginx-access.log nginx-error.log
$ cat logs/*
172.17.0.1 - - [27/Mar/2018:02:11:35 +0000] "GET / HTTP/1.1" 404 572 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36" "-"
2018/03/27 02:11:35 [error] 5#5: *1 "/var/wwww/html/index.php" is not found (2: No such file or directory), client: 172.17.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost"


My nginx/nginx.conf looks like this:



server {
listen 80;

# this path MUST be exactly as docker-compose.fpm.volumes,
# even if it doesn't exists in this dock.
root /var/wwww/html;
index index.php index.html index.html;

server_name localhost;

location ~ .php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass phpfpm:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}


My docker-compose.yml looks like:



nginx:
image: nginx
restart: always
ports:
- "80:80"
links:
- phpfpm
- db
volumes:
- ./logs/nginx-error.log:/var/log/nginx/error.log
- ./logs/nginx-access.log:/var/log/nginx/access.log
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
- ./public/:/var/www/html

phpfpm:
build: ./mGSV
restart: always
ports:
- "9000:9000"
links:
- db
volumes:
- ./public/:/var/www/html

db:
image: mariadb
restart: always
environment:
- MYSQL_ROOT_PASSWORD=admin
- MYSQL_DATABASE=mgsv
- MYSQL_USER=mgsv_user
- MYSQL_PASSWORD=mgsvpass
ports:
- "3306:3306"
volumes:
- ./mysql/:/docker-entrypoint-initdb.d

phpmyadmin:
image: phpmyadmin/phpmyadmin
restart: always
links:
- db
ports:
- 8183:80
environment:
PMA_USER: root
PMA_PASSWORD: admin
PMA_ARBITRARY: 1


My ./mGSV/Dockerfile is based on:



FROM php:5-fpm


What did I miss?



Thank you in advance.










share|improve this question
















bumped to the homepage by Community 3 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Can you give the output of ls -al /var/www/html/?

    – Alex
    Mar 27 '18 at 5:37











  • It is empty $ docker run --entrypoint /bin/bash -i -t mgsvdocker2_phpfpm. How is it possible?

    – user977828
    Mar 27 '18 at 7:28











  • The only difference to the other containers in the docker-compose.yml is that phpfpm get build: ./mGSV from a Dockerfile.

    – user977828
    Mar 27 '18 at 15:30
















0















I got inside the browser:



404 Not Found
nginx/1.13.10


and in the logs I got:



$ ls logs/
nginx-access.log nginx-error.log
$ cat logs/*
172.17.0.1 - - [27/Mar/2018:02:11:35 +0000] "GET / HTTP/1.1" 404 572 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36" "-"
2018/03/27 02:11:35 [error] 5#5: *1 "/var/wwww/html/index.php" is not found (2: No such file or directory), client: 172.17.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost"


My nginx/nginx.conf looks like this:



server {
listen 80;

# this path MUST be exactly as docker-compose.fpm.volumes,
# even if it doesn't exists in this dock.
root /var/wwww/html;
index index.php index.html index.html;

server_name localhost;

location ~ .php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass phpfpm:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}


My docker-compose.yml looks like:



nginx:
image: nginx
restart: always
ports:
- "80:80"
links:
- phpfpm
- db
volumes:
- ./logs/nginx-error.log:/var/log/nginx/error.log
- ./logs/nginx-access.log:/var/log/nginx/access.log
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
- ./public/:/var/www/html

phpfpm:
build: ./mGSV
restart: always
ports:
- "9000:9000"
links:
- db
volumes:
- ./public/:/var/www/html

db:
image: mariadb
restart: always
environment:
- MYSQL_ROOT_PASSWORD=admin
- MYSQL_DATABASE=mgsv
- MYSQL_USER=mgsv_user
- MYSQL_PASSWORD=mgsvpass
ports:
- "3306:3306"
volumes:
- ./mysql/:/docker-entrypoint-initdb.d

phpmyadmin:
image: phpmyadmin/phpmyadmin
restart: always
links:
- db
ports:
- 8183:80
environment:
PMA_USER: root
PMA_PASSWORD: admin
PMA_ARBITRARY: 1


My ./mGSV/Dockerfile is based on:



FROM php:5-fpm


What did I miss?



Thank you in advance.










share|improve this question
















bumped to the homepage by Community 3 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Can you give the output of ls -al /var/www/html/?

    – Alex
    Mar 27 '18 at 5:37











  • It is empty $ docker run --entrypoint /bin/bash -i -t mgsvdocker2_phpfpm. How is it possible?

    – user977828
    Mar 27 '18 at 7:28











  • The only difference to the other containers in the docker-compose.yml is that phpfpm get build: ./mGSV from a Dockerfile.

    – user977828
    Mar 27 '18 at 15:30














0












0








0








I got inside the browser:



404 Not Found
nginx/1.13.10


and in the logs I got:



$ ls logs/
nginx-access.log nginx-error.log
$ cat logs/*
172.17.0.1 - - [27/Mar/2018:02:11:35 +0000] "GET / HTTP/1.1" 404 572 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36" "-"
2018/03/27 02:11:35 [error] 5#5: *1 "/var/wwww/html/index.php" is not found (2: No such file or directory), client: 172.17.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost"


My nginx/nginx.conf looks like this:



server {
listen 80;

# this path MUST be exactly as docker-compose.fpm.volumes,
# even if it doesn't exists in this dock.
root /var/wwww/html;
index index.php index.html index.html;

server_name localhost;

location ~ .php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass phpfpm:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}


My docker-compose.yml looks like:



nginx:
image: nginx
restart: always
ports:
- "80:80"
links:
- phpfpm
- db
volumes:
- ./logs/nginx-error.log:/var/log/nginx/error.log
- ./logs/nginx-access.log:/var/log/nginx/access.log
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
- ./public/:/var/www/html

phpfpm:
build: ./mGSV
restart: always
ports:
- "9000:9000"
links:
- db
volumes:
- ./public/:/var/www/html

db:
image: mariadb
restart: always
environment:
- MYSQL_ROOT_PASSWORD=admin
- MYSQL_DATABASE=mgsv
- MYSQL_USER=mgsv_user
- MYSQL_PASSWORD=mgsvpass
ports:
- "3306:3306"
volumes:
- ./mysql/:/docker-entrypoint-initdb.d

phpmyadmin:
image: phpmyadmin/phpmyadmin
restart: always
links:
- db
ports:
- 8183:80
environment:
PMA_USER: root
PMA_PASSWORD: admin
PMA_ARBITRARY: 1


My ./mGSV/Dockerfile is based on:



FROM php:5-fpm


What did I miss?



Thank you in advance.










share|improve this question
















I got inside the browser:



404 Not Found
nginx/1.13.10


and in the logs I got:



$ ls logs/
nginx-access.log nginx-error.log
$ cat logs/*
172.17.0.1 - - [27/Mar/2018:02:11:35 +0000] "GET / HTTP/1.1" 404 572 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36" "-"
2018/03/27 02:11:35 [error] 5#5: *1 "/var/wwww/html/index.php" is not found (2: No such file or directory), client: 172.17.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost"


My nginx/nginx.conf looks like this:



server {
listen 80;

# this path MUST be exactly as docker-compose.fpm.volumes,
# even if it doesn't exists in this dock.
root /var/wwww/html;
index index.php index.html index.html;

server_name localhost;

location ~ .php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass phpfpm:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}


My docker-compose.yml looks like:



nginx:
image: nginx
restart: always
ports:
- "80:80"
links:
- phpfpm
- db
volumes:
- ./logs/nginx-error.log:/var/log/nginx/error.log
- ./logs/nginx-access.log:/var/log/nginx/access.log
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
- ./public/:/var/www/html

phpfpm:
build: ./mGSV
restart: always
ports:
- "9000:9000"
links:
- db
volumes:
- ./public/:/var/www/html

db:
image: mariadb
restart: always
environment:
- MYSQL_ROOT_PASSWORD=admin
- MYSQL_DATABASE=mgsv
- MYSQL_USER=mgsv_user
- MYSQL_PASSWORD=mgsvpass
ports:
- "3306:3306"
volumes:
- ./mysql/:/docker-entrypoint-initdb.d

phpmyadmin:
image: phpmyadmin/phpmyadmin
restart: always
links:
- db
ports:
- 8183:80
environment:
PMA_USER: root
PMA_PASSWORD: admin
PMA_ARBITRARY: 1


My ./mGSV/Dockerfile is based on:



FROM php:5-fpm


What did I miss?



Thank you in advance.







nginx mysql php docker docker-compose






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 27 '18 at 2:45







user977828

















asked Mar 27 '18 at 2:33









user977828user977828

1086




1086





bumped to the homepage by Community 3 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 3 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Can you give the output of ls -al /var/www/html/?

    – Alex
    Mar 27 '18 at 5:37











  • It is empty $ docker run --entrypoint /bin/bash -i -t mgsvdocker2_phpfpm. How is it possible?

    – user977828
    Mar 27 '18 at 7:28











  • The only difference to the other containers in the docker-compose.yml is that phpfpm get build: ./mGSV from a Dockerfile.

    – user977828
    Mar 27 '18 at 15:30



















  • Can you give the output of ls -al /var/www/html/?

    – Alex
    Mar 27 '18 at 5:37











  • It is empty $ docker run --entrypoint /bin/bash -i -t mgsvdocker2_phpfpm. How is it possible?

    – user977828
    Mar 27 '18 at 7:28











  • The only difference to the other containers in the docker-compose.yml is that phpfpm get build: ./mGSV from a Dockerfile.

    – user977828
    Mar 27 '18 at 15:30

















Can you give the output of ls -al /var/www/html/?

– Alex
Mar 27 '18 at 5:37





Can you give the output of ls -al /var/www/html/?

– Alex
Mar 27 '18 at 5:37













It is empty $ docker run --entrypoint /bin/bash -i -t mgsvdocker2_phpfpm. How is it possible?

– user977828
Mar 27 '18 at 7:28





It is empty $ docker run --entrypoint /bin/bash -i -t mgsvdocker2_phpfpm. How is it possible?

– user977828
Mar 27 '18 at 7:28













The only difference to the other containers in the docker-compose.yml is that phpfpm get build: ./mGSV from a Dockerfile.

– user977828
Mar 27 '18 at 15:30





The only difference to the other containers in the docker-compose.yml is that phpfpm get build: ./mGSV from a Dockerfile.

– user977828
Mar 27 '18 at 15:30










1 Answer
1






active

oldest

votes


















0














I am not familiar with docker but I see 2 inconsistencies here:



Independent of the docker part, nginx (nginx/nginx.conf) tries to serve content from
/var/wwww/html. This is probably a typo (did you mean /var/www/html?). Thus the exact error message "/var/wwww/html/index.php" is not found (2: No such file or directory) - there has to be content in this folder for this nginx config to work.



Also your nginx comment says # this path MUST be exactly as docker-compose.fpm.volumes, but the phpfpm volumes part in your docker-compose.yml says ./public/:/var/www/html.



What are you actually trying to achieve?






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "2"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f904716%2f404-not-found-with-nginx-and-php%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I am not familiar with docker but I see 2 inconsistencies here:



    Independent of the docker part, nginx (nginx/nginx.conf) tries to serve content from
    /var/wwww/html. This is probably a typo (did you mean /var/www/html?). Thus the exact error message "/var/wwww/html/index.php" is not found (2: No such file or directory) - there has to be content in this folder for this nginx config to work.



    Also your nginx comment says # this path MUST be exactly as docker-compose.fpm.volumes, but the phpfpm volumes part in your docker-compose.yml says ./public/:/var/www/html.



    What are you actually trying to achieve?






    share|improve this answer




























      0














      I am not familiar with docker but I see 2 inconsistencies here:



      Independent of the docker part, nginx (nginx/nginx.conf) tries to serve content from
      /var/wwww/html. This is probably a typo (did you mean /var/www/html?). Thus the exact error message "/var/wwww/html/index.php" is not found (2: No such file or directory) - there has to be content in this folder for this nginx config to work.



      Also your nginx comment says # this path MUST be exactly as docker-compose.fpm.volumes, but the phpfpm volumes part in your docker-compose.yml says ./public/:/var/www/html.



      What are you actually trying to achieve?






      share|improve this answer


























        0












        0








        0







        I am not familiar with docker but I see 2 inconsistencies here:



        Independent of the docker part, nginx (nginx/nginx.conf) tries to serve content from
        /var/wwww/html. This is probably a typo (did you mean /var/www/html?). Thus the exact error message "/var/wwww/html/index.php" is not found (2: No such file or directory) - there has to be content in this folder for this nginx config to work.



        Also your nginx comment says # this path MUST be exactly as docker-compose.fpm.volumes, but the phpfpm volumes part in your docker-compose.yml says ./public/:/var/www/html.



        What are you actually trying to achieve?






        share|improve this answer













        I am not familiar with docker but I see 2 inconsistencies here:



        Independent of the docker part, nginx (nginx/nginx.conf) tries to serve content from
        /var/wwww/html. This is probably a typo (did you mean /var/www/html?). Thus the exact error message "/var/wwww/html/index.php" is not found (2: No such file or directory) - there has to be content in this folder for this nginx config to work.



        Also your nginx comment says # this path MUST be exactly as docker-compose.fpm.volumes, but the phpfpm volumes part in your docker-compose.yml says ./public/:/var/www/html.



        What are you actually trying to achieve?







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 28 '18 at 12:17









        mlistmlist

        112




        112






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Server Fault!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f904716%2f404-not-found-with-nginx-and-php%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

            Список ссавців Італії Природоохоронні статуси | Список |...

            Українські прізвища Зміст Історичні відомості |...