3
So guys I think it’s some configuration on the server that’s not showing the error page, I’m running a docker-compose that "goes up" a container php, mysql and Nginx but when accessing localhost comes to me the following error:
-403 Forbidden
Follow the Nginx configuration file:
server {
    listen 80;
    index index.php index.html;
    server_name localhost;
    error_log  /var/log/nginx/error.log;
    access_log /var/log/nginx/access.log;
    root /code;
    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass php:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }
}
And the Docker-Compose to get the curiosity:
version: '2'
services:
    web:
        image: nginx:latest
        ports:
            - "80:80"
        volumes:
            - ./code/public_html:/code
            - ./site.conf:/etc/nginx/conf.d/default.conf
        links:
            - php
    php:
        image: php7-custom-conf
        volumes:
            - ./code/public_html:/code
        links:
            - db
    db:
        image: mysql:5.7
        volumes:
        - "./.data/db:/var/lib/mysql"
        restart: always
        ports:
            - "3306:3306"
        environment:
         MYSQL_ROOT_PASSWORD: dbrootpass
         MYSQL_DATABASE: dbname
         MYSQL_USER: dbuser
         MYSQL_PASSWORD: dbpass
All help is welcome at the end of the semester and I really can’t see the error, I thank you.
in case if I add the part of mysql goes without any problem is not?
– William.Andrade
No, you can add whatever you need in this Poser. .
– Fabio Luis Alexandre