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

nginx won't run / can't be reached #660

Closed
nckrtl opened this issue Mar 8, 2017 · 15 comments
Closed

nginx won't run / can't be reached #660

nckrtl opened this issue Mar 8, 2017 · 15 comments

Comments

@nckrtl
Copy link

nckrtl commented Mar 8, 2017

Hi,

I'm struggling for some hours to get laradock running but it seems that nginx just start running. Mysql however can be reached with Sequel Pro. But when i open the browser it shows me that the page can't be reached.

When i do docker ps i get:

CONTAINER ID        IMAGE                COMMAND                  CREATED             STATUS              PORTS                    NAMES
0138dd54fbf3        laradock_php-fpm     "php-fpm"                55 seconds ago      Up 54 seconds       9000/tcp                 laradock_php-fpm_1
566bd2bb4a88        laradock_workspace   "/sbin/my_init"          56 seconds ago      Up 55 seconds       0.0.0.0:2222->22/tcp     laradock_workspace_1
b700a11ada1e        laradock_mysql       "docker-entrypoint..."   58 seconds ago      Up 56 seconds       0.0.0.0:3306->3306/tcp   laradock_mysql_1
af488f4291e8        laradock_redis       "docker-entrypoint..."   58 seconds ago      Up 55 seconds       0.0.0.0:6379->6379/tcp   laradock_redis_1

And what's missing in that list is nginx, im not sure on how to troubleshoot this issue.

When i do docker-compose down i do see nginx in the list:

Stopping laradock_php-fpm_1 ... done
Stopping laradock_workspace_1 ... done
Stopping laradock_mysql_1 ... done
Stopping laradock_redis_1 ... done
Removing laradock_nginx_1 ... done
Removing laradock_php-fpm_1 ... done
Removing laradock_workspace_1 ... done
Removing laradock_mysql_1 ... done
Removing laradock_redis_1 ... done
Removing laradock_applications_1 ... done

Anyone who might know what going on here?

@manshoor
Copy link

manshoor commented Mar 8, 2017

That's weird,

ok, lets clear all the containers and dangling images using this command docker system prune and try again with building the containers that you need

OR

try force recreating with no cache using this command docker-compose build --force-rm --no-cache nginx

@nckrtl
Copy link
Author

nckrtl commented Mar 8, 2017

I did the first command:

NMBP:laradock nckrtl$ docker system prune
WARNING! This will remove:
	- all stopped containers
	- all volumes not used by at least one container
	- all networks not used by at least one container
	- all dangling images
Are you sure you want to continue? [y/N] y
Deleted Volumes:
laradock_minio
laradock_mongo
laradock_phpmyadmin
laradock_aerospike
laradock_caddy
laradock_redis
laradock_elasticsearch-data
laradock_elasticsearch-plugins
laradock_mysql
laradock_rethinkdb
laradock_mariadb
laradock_memcached
laradock_neo4j
laradock_postgres
laradock_sessions

Deleted Images:
deleted: sha256:92fbbd5e9790f11f8dbead393e3a89c08ed9fd2337924ef2d1167b3241be2280
deleted: sha256:ddf3c3ea3eecdd592d27b03bd9de9dbb8c6d37cd99f63484fd7a228da529b342
deleted: sha256:79fb343876a8a5e7e65942546a2ddfe98a6773fbab52ce55581831fd95e43eb3
deleted: sha256:f2bfb57986434d7833a08ab9d83ad07669f2ac34d11949e8f5c70929043c5c76
deleted: sha256:0093053a691ed63118cec6e5d6f75838fb7a70811eea8308f6f99e9a6762a91c
deleted: sha256:19c3b89737a46e52e06d9b8a48551c46ed521bafe7b5c7dab03b54a4b4c83d1b
deleted: sha256:d27639f11210b5b92b4cc45e427861b1cecf0773c075c3095d6e16ccfb9f6f1c
deleted: sha256:20297fae75b06631f5ed18857fe310e1589a2604d8c762cb394a81ea53c63b6b
deleted: sha256:e9df0b9dbb26c7067647e7dfc88c4feea34c85139eb6c7e874f72caf19755e3c
deleted: sha256:510c48c626b57252809fefd85e3c2d4489153afbddf7b9b802dcf7a1842c2750
deleted: sha256:0d1dbacd4c3b9d9344edccc75036a0a5713363a081cde104f515328f0d3be14c
deleted: sha256:6651069390731a947c7f107d0ebe3cb9369b3a006f61e404f8e1d7d08a667988
deleted: sha256:02f81ff887d33b76b0d0c75b97fd30ea632b301b63cc9e9ebf659385731806e9
deleted: sha256:9572470373ac1e9922f8dedb436c4e69ecf73d0cf98d0370f6ccaa0e13923eef
deleted: sha256:14e8ed390dcfde380e8702418bb33d4663def39c7ac0dbd92e2a99744b2472c7
deleted: sha256:b1304d874228e472fef717cbb5076350f6ea5a10065931d53a9a43f0ec8477cf
deleted: sha256:7803294fe02f507c093aa56b329ab5d4c5d36606e1ca38f8d2ca31fcb29dc04e
deleted: sha256:8c6ca11c85ecc3cceb9cff75327984592b6e7c087a5d3d70a9e7416fbabbbb6b
deleted: sha256:27bdc63d3f9b9ade730351409deaba1aaab5fd1df4538114ee0b4ebe98f72a92
deleted: sha256:df36224d842cc4b96b2b5fca456a6edaba97304300a3e8147c66ecef8ec1b607
deleted: sha256:efd3d5818bcca322d2c6f9ed917d9c187b435639f71ae5c6188fadfcdf680794
deleted: sha256:422a17954d3fbea87117d5be942a363a1324a1043d38de856785d6ec814ef95a
deleted: sha256:2a260194455b03d0c60fef6af914438bb4d8f4db65d5679981ad5a1b1199a530
deleted: sha256:9e2b2421df31221bc264d3e350a6e9a9c506677e62c77153f91f371795edcc5d
deleted: sha256:8e8e67f15a293da12afa4fdd5f684b681d663dc63961836197aff8ab769420e9
deleted: sha256:4f44ed5f8009ded2dc478c5e6a6ec95d48401dc6ec6c9ae44b4628387ef628c9
deleted: sha256:ea7ab15a16041588d2a537478fa7d1e0a09ced744e8507cc26376e67283e2d15
deleted: sha256:6e59392a5777d0625f63ed2a4b4558a9e93acfb1ee99024b6a47c3f8e30b5ad6
deleted: sha256:08c1515aab0dea33285e5b4e914640063a30199363af84d003fb796eb3a6d073
deleted: sha256:24ef6e375b9bd7969cfd4382093767e600f90b1df40db230bb7f288e88355b6a
deleted: sha256:b2202879eb5fdc4a2c08e2799cba538475f148a50551b46b6fcfd2e51804a7b7
deleted: sha256:b5e7c599e0fa1867b903d057bce53af6b9fc24e478f4b587a0179f254821f020
deleted: sha256:b999e482eb38143b56ee9490f85c723bc2bea179e9db4a1342eea3366443add3
deleted: sha256:53372bf09723400b74bc81659be343d5cdb2fc84ce17540b4dd94a6c1ae1b033
deleted: sha256:5b1627b0ebf09a43eeff8b34de21acbad5962881f092eb1dd19448170812a5ff
deleted: sha256:b13f8d920879368667f0a110d0c65401f5f9fbabbd7d24c085d116fac65cbbba
deleted: sha256:eb2c4abc2109ac052aeb47320d72d664f38a4f8a6dbe7332a379ed09548fb240
deleted: sha256:71c8e4e9c5cc8b91b9539b4b19fa1cafb76882182fdca3b39d5b4551593eb872
deleted: sha256:7ef99838a8959b476e7876d655ff8be186aee199177bba9fcee6a3d698295238
deleted: sha256:9fb452a97fed13ad66b0b3349158dc95c289f0a648d675e63d85dedc748ed01f
deleted: sha256:9e7600c89dfd27edff5ed5c264c3397f3f0897e0ea52a03786f0a4b239aef6f3
deleted: sha256:7081a118d0a2e1dd0a2c291f399fa6978d0a981185d0c10b0776bc073f82cc4f
deleted: sha256:ad570cec4f18011b8c559a02f8dfca31dfefeb562f07af9771462b9d34aec631
deleted: sha256:8d9123645f8a7b092517dd256b6b0f839fe98628c40dc7108e0632da5f2da178
deleted: sha256:b7f778ac44b64a6562a692393694d287bd4a4a261f7030d8fbc871fcddff3a17
deleted: sha256:f82c9b1a8e167cf66ca62f7296469d954ae8bc7572fe28e8a8454d9d93cb0838
deleted: sha256:befbe827327a36dc5b1fe10718ab300464d8f0b84b96951c8e8f7148f5e2a70b
deleted: sha256:32e6ad45c667c203d84a285cb262be1046825f1da257522cf85e799848f27ced
deleted: sha256:b457af1fd842cf4cf546cf4d4d272146bb23cfbe4f0f56f713e334739d388598
deleted: sha256:979ea709eb758f00a669623d362103a0dc076ea3b85f7f234d428bbcdb1edd61
deleted: sha256:846fe9eee3791564c4443fd07c6066bcee0d318c739057022f71b348ca2a4b9a
deleted: sha256:e2ef9a7432924a1b658405b05b51ece72778f418491626dfda7dd1bb25276375
deleted: sha256:f64cc014f62a6ea37005b1b741a58bde868f3d80a83b7b9bc416429280f70490
deleted: sha256:7b4f695603aa0cea26ef67fd4e5288f9f7c9bb3285e4d492d21fd97d9b8b206c
deleted: sha256:7c6bf5af2c90cf5f53406c3fedfa1b01f91534e4727d829ab44997d8667e9ce9
deleted: sha256:a03b805ed7311a32ac44d08e35033b0c426ebb57cc3843834080e7ca13b96b68
deleted: sha256:aebecd201bda9d57b88a0d57951c0f9c6395c60442d3c1f23f4f0fca1935e972
deleted: sha256:2b63a6efb95eda56c04b083b177021f65328c1d965eecf814628ffa8fa44d007
deleted: sha256:06689f24f9ee79481839410bfe9c2ae78f334ca1a7d23b20dfb64104522f18c6
deleted: sha256:f943db8d05d7879dca0976de3cc89cf60d97d4837997c1326aea06e377dc817d
deleted: sha256:1ba912a696cfeee69ad560e8bfb12590c3f418ada358f444e1962ba35c5d0bf7
deleted: sha256:e43cda0d3fbbaddfe0346ac17a86816ea2e5eeb8be2600ca57200c4474628775
deleted: sha256:7e8440e78295512e829be9fa5e1c91a7c9113fb056d02bc8f0175f3f190a3e92
deleted: sha256:e20274d6d62b70100acc8d4c3dec8276c0d22077a445e66f779f1cd7ac39a2ea
deleted: sha256:15e96c731f3b5abe89c7c4006658fce7c95829e200323c761fd26f7ff3befa80
deleted: sha256:2046fb58d066e7665132ba3a97b0b78a175756eeac2b509f763e71cb097b2a20
deleted: sha256:a002995824261c3a0de281b15370eae47f42a2437225ec12cb33df3c33dd2ccc
deleted: sha256:b5be2bd5aa323b202e16a1a1b75ac9f1c75cc7768ed46c965e7ca076355eacd1
deleted: sha256:cfa77c71250cf99631e4885129faffa5be8ecb0939b1c4fd66fa6fa616ccdd4a
deleted: sha256:4ab931eed532feaa68ad06a5bb3502f279d0eac52b15300f5f6c39ea43525029
deleted: sha256:23621800dbb0881342dc174824ff757d93dad4441aad37ea6402bb5540878410
deleted: sha256:eadeb4d395c75b3c3eaa11f1db111d6a768c237e62a0bc7469edfe1fee1ec896
deleted: sha256:3ced569086701a902a7019f7b3e2b0164c318d75162cbd82be4f553b169d689c
deleted: sha256:586a46af4a15640ba3f1f3c6b7d5cd73b7bc0b60f63c39abce20c8011d87439d
deleted: sha256:50bade5f1974062af680b4ff36a5fb3564e759d54b947f5d40b3f0f1ca060429
deleted: sha256:a8248a275635db79e223b09677ca52f3b2dde448f3306e56846638efaeac17ed
deleted: sha256:a1fd397ba6844cd736f92c2b65ef0a79441a10503283fa9582815a502778c026
deleted: sha256:8e59c5c21f38ac40511125439e66e4b137d3a11497905ed9f35e05e4e026738f
deleted: sha256:4678544239feaa20587005b2899e3da0ff361abe0d156fcd96444d38c302841e
deleted: sha256:3401baf9e0d70b0aa086f799c819ebcd1472dc37ae6163a66ae941ca41025433

Total reclaimed space: 234.5 MB

Then i started it again with:
NMBP:laradock nckrtl$ docker-compose up -d nginx mysql redis

Output:

Creating network "laradock_default" with the default driver
Creating volume "laradock_phpmyadmin" with local driver
Creating volume "laradock_rethinkdb" with local driver
Creating volume "laradock_elasticsearch-plugins" with local driver
Creating volume "laradock_elasticsearch-data" with local driver
Creating volume "laradock_postgres" with local driver
Creating volume "laradock_aerospike" with local driver
Creating volume "laradock_sessions" with local driver
Creating volume "laradock_redis" with local driver
Creating volume "laradock_minio" with local driver
Creating volume "laradock_caddy" with local driver
Creating volume "laradock_mysql" with local driver
Creating volume "laradock_neo4j" with local driver
Creating volume "laradock_mariadb" with local driver
Creating volume "laradock_memcached" with local driver
Creating volume "laradock_mongo" with local driver
Creating laradock_applications_1
Creating laradock_redis_1
Creating laradock_mysql_1
Creating laradock_workspace_1
Creating laradock_php-fpm_1
Creating laradock_nginx_1

Then i checked again with ps command and now it shows up but with state exit 1 for nginx but also mysql which i cant reach anymore as well:

         Name                        Command               State            Ports          
------------------------------------------------------------------------------------------
laradock_applications_1   /true                            Exit 0                          
laradock_mysql_1          docker-entrypoint.sh mysql ...   Exit 1                          
laradock_nginx_1          nginx                            Exit 1                          
laradock_php-fpm_1        php-fpm                          Up       9000/tcp               
laradock_redis_1          docker-entrypoint.sh redis ...   Up       0.0.0.0:6379->6379/tcp 
laradock_workspace_1      /sbin/my_init                    Up       0.0.0.0:2222->22/tcp 

I tried looking into the log file but that shows log entries right before my first post, which inidicates nginx was kinda working. After the latest log entry 2 hours ago there are no new ones. The most recent one is about ssl (which i tried to install with custom domain, thats where it went wrong i think):

2017/03/08 20:16:12 [emerg] 1#1: BIO_new_file("/etc/nginx/ssl/YOURLOCALDOMAIN.local.crt") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/nginx/ssl/YOURLOCALDOMAIN.local.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

So i guess I need to figure out why mysql and nginx have an error 1 state

@manshoor
Copy link

manshoor commented Mar 8, 2017

try building individual containers with this command and see what's causing the problem docker-compose build --force-rm --no-cache [SERVICE NAME]

@nckrtl
Copy link
Author

nckrtl commented Mar 9, 2017

Ok so I got it working by starting all fresh.

docker-compose ps:

         Name                        Command               State                     Ports                   
------------------------------------------------------------------------------------------------------------
laradock_applications_1   /true                            Exit 0                                            
laradock_mysql_1          docker-entrypoint.sh mysql ...   Up       0.0.0.0:3306->3306/tcp                   
laradock_nginx_1          nginx                            Up       0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp 
laradock_php-fpm_1        php-fpm                          Up       9000/tcp                                 
laradock_redis_1          docker-entrypoint.sh redis ...   Up       0.0.0.0:6379->6379/tcp                   
laradock_workspace_1      /sbin/my_init                    Up       0.0.0.0:2222->22/tcp 

However when I try to reach the larvel project I get this in chrome:

This site can’t be reached
127.0.0.1 unexpectedly closed the connection.

However the nginx logs aren't showing any new log entries. Any ideas on how to debug this?

Edit: I do know it's reachable under 127.0.0.1 because when I bring nginx down chrome says "local2.securelogin.nu refused to connect." instead of "unexpectedly closed the connection."

@manshoor
Copy link

manshoor commented Mar 9, 2017

what OS you are using?

check and verify your volume mounting also check the nginx config if it is picking up the right directory.

infact kindly share your docker-compose.yaml and nginx config what you are using

@nckrtl
Copy link
Author

nckrtl commented Mar 9, 2017

I'm running on Mac

docker-compose.yml:

version: '2'

services:

### Applications Code Container #############################

    applications:
        image: tianon/true
        volumes:
            - ../:/var/www
#            - ../sample/:/var/www/sample

### Workspace Utilities Container ###########################

    workspace:
        build:
            context: ./workspace
            args:
                - INSTALL_XDEBUG=false
                - INSTALL_SOAP=false
                - INSTALL_MONGO=false
                - INSTALL_NODE=false
                - INSTALL_YARN=false
                - INSTALL_DRUSH=false
                - INSTALL_AEROSPIKE_EXTENSION=false
                - INSTALL_V8JS_EXTENSION=false
                - COMPOSER_GLOBAL_INSTALL=false
                - INSTALL_WORKSPACE_SSH=false
                - INSTALL_LARAVEL_ENVOY=false
                - INSTALL_DEPLOYER=false
                - INSTALL_LINUXBREW=false
                - INSTALL_MC=false
                - PUID=1000
                - PGID=1000
                - NODE_VERSION=stable
                - YARN_VERSION=latest
                - TZ=CET
        volumes_from:
            - applications
        extra_hosts:
            # IMPORTANT: Replace with your Docker Host IP (will be appended to /etc/hosts)
            - "dockerhost:10.0.75.1"
        ports:
           - "2222:22"
        tty: true

### PHP-FPM Container #######################################

    php-fpm:
        build:
            context: ./php-fpm
            args:
                - INSTALL_XDEBUG=false
                - INSTALL_SOAP=false
                - INSTALL_MONGO=false
                - INSTALL_ZIP_ARCHIVE=false
                - INSTALL_BCMATH=false
                - INSTALL_PHPREDIS=false
                - INSTALL_MEMCACHED=false
                - INSTALL_OPCACHE=false
                - INSTALL_EXIF=false
                - INSTALL_AEROSPIKE_EXTENSION=false
                - CODEIGNITER=false
            dockerfile: Dockerfile-70
        volumes_from:
            - applications
        expose:
            - "9000"
        links:
            - workspace
        extra_hosts:
            # IMPORTANT: Replace with your Docker Host IP (will be appended to /etc/hosts)
            - "dockerhost:10.0.75.1"
        environment:
            # IMPORTANT: Set the Remote Interpreter entry matching name to `laravel`
            - PHP_IDE_CONFIG=serverName=laravel

### Nginx Server Container ##################################

    nginx:
        build:
            context: ./nginx
            args:
                - PHP_UPSTREAM=php-fpm
        volumes_from:
            - applications
        volumes:
            - ./logs/nginx/:/var/log/nginx
            - ./nginx/sites/:/etc/nginx/sites-available
        ports:
            - "80:80"
            - "443:443"
        links:
            - php-fpm

### Apache Server Container #################################

    apache2:
        build:
            context: ./apache2
            args:
                - PHP_SOCKET=php-fpm:9000
        volumes_from:
            - applications
        volumes:
            - ./logs/apache2:/var/log/apache2
        ports:
            - "80:80"
            - "443:443"
        links:
            - php-fpm

### HHVM Container ##########################################

    hhvm:
        build: ./hhvm
        volumes_from:
            - applications
        expose:
            - "9000"
        links:
            - workspace

### Minio Container #########################################

    minio:
        build: ./minio
        volumes:
            - minio:/export
        ports:
          - "9000:9000"
        environment:
          MINIO_ACCESS_KEY: access
          MINIO_SECRET_KEY: secretkey

### MySQL Container #########################################

    mysql:
        build:
            context: ./mysql
            args:
                - MYSQL_DATABASE=homestead
                - MYSQL_USER=homestead
                - MYSQL_PASSWORD=secret
                - MYSQL_ROOT_PASSWORD=root
        volumes:
            - mysql:/var/lib/mysql
        ports:
            - "3306:3306"

### MariaDB Container #######################################

    mariadb:
        build: ./mariadb
        volumes:
            - mariadb:/var/lib/mysql
        ports:
            - "3306:3306"
        environment:
            MYSQL_DATABASE: homestead
            MYSQL_USER: homestead
            MYSQL_PASSWORD: secret
            MYSQL_ROOT_PASSWORD: root

### PostgreSQL Container ####################################

    postgres:
        build: ./postgres
        volumes:
            - postgres:/var/lib/postgresql/data
        ports:
            - "5432:5432"
        environment:
            POSTGRES_DB: homestead
            POSTGRES_USER: homestead
            POSTGRES_PASSWORD: secret

### PostgreSQL PostGis Container ############################

    postgres-postgis:
        build: ./postgres-postgis
        volumes:
            - postgres:/var/lib/postgresql/data
        ports:
            - "5432:5432"
        environment:
            POSTGRES_DB: homestead
            POSTGRES_USER: homestead
            POSTGRES_PASSWORD: secret

### Neo4j Container #########################################

    neo4j:
        build: ./neo4j
        ports:
            - "7474:7474"
            - "1337:1337"
        environment:
            - NEO4J_AUTH=homestead:secret
        volumes:
            - neo4j:/var/lib/neo4j/data

### MongoDB Container #######################################

    mongo:
        build: ./mongo
        ports:
            - "27017:27017"
        volumes:
            - mongo:/data/db

### RethinkDB Container #######################################

    rethinkdb:
        build: ./rethinkdb
        ports:
            - "8090:8080"
        volumes:
            - rethinkdb:/data/rethinkdb_data

### Redis Container #########################################

    redis:
        build: ./redis
        volumes:
            - redis:/data
        ports:
            - "6379:6379"

### Aerospike c Container ###################################

    aerospike:
        build: ./aerospike
        volumes_from:
            - workspace
        volumes:
            - aerospike:/opt/aerospike/data
        ports:
            - "3000:3000"
            - "3001:3001"
            - "3002:3002"
            - "3003:3003"


### Memcached Container #####################################

    memcached:
        build: ./memcached
        volumes:
            - memcached:/var/lib/memcached
        ports:
            - "11211:11211"
        links:
            - php-fpm

### Beanstalkd Container ####################################

    beanstalkd:
        build: ./beanstalkd
        ports:
            - "11300:11300"
        privileged: true
        links:
            - php-fpm

### RabbitMQ Container ######################################

    rabbitmq:
        build: ./rabbitmq
        ports:
            - "5672:5672"
            - "15671:15671"
            - "8080:15672"
        privileged: true
        environment:
            RABBITMQ_DEFAULT_USER: guest
            RABBITMQ_DEFAULT_PASS: guest
        links:
            - php-fpm

### Beanstalkd Console Container ############################

    beanstalkd-console:
        build: ./beanstalkd-console
        ports:
            - "2080:2080"
        links:
            - beanstalkd

### Caddy Server Container ##################################

    caddy:
        build: ./caddy
        ports:
            - "80:80"
            - "443:443"
            - "2015:2015"
        volumes_from:
            - applications
        volumes:
            - ./caddy/Caddyfile:/etc/Caddyfile
            - ./logs/caddy:/var/log/caddy
            - caddy:/root/.caddy
        links:
            - php-fpm

### phpMyAdmin Container ####################################

    phpmyadmin:
        build: ./phpmyadmin
        environment:
            PMA_ARBITRARY: 1
            MYSQL_USER: homestead
            MYSQL_PASSWORD: secret
            MYSQL_ROOT_PASSWORD: root
        ports:
            - "8080:80"
        links:
            # for mysql container
            - "mysql:db"
            # for mariadb container
            # - "mariadb:db"

### pgAdmin Container #######################################

    pgadmin:
        build: ./pgadmin
        ports:
            - "5050:5050"
        links:
            - postgres

### ElasticSearch Container #################################

    elasticsearch:
        build: ./elasticsearch
        volumes:
            - elasticsearch-data:/usr/share/elasticsearch/data
            - elasticsearch-plugins:/usr/share/elasticsearch/data
        ports:
            - "9200:9200"
            - "9300:9300"
        links:
            - php-fpm

### Selenium Container #########################################

    selenium:
        build: ./selenium
        ports:
            - "4444:4444"
        volumes:
            # see https://github.com/SeleniumHQ/docker-selenium#running-the-images
            - /dev/shm:/dev/shm

### Volumes Setup ###########################################

volumes:
    mysql:
        driver: "local"
    postgres:
        driver: "local"
    memcached:
        driver: "local"
    redis:
        driver: "local"
    neo4j:
        driver: "local"
    mariadb:
        driver: "local"
    mongo:
        driver: "local"
    minio:
        driver: "local"
    rethinkdb:
        driver: "local"
    phpmyadmin:
        driver: "local"
    aerospike:
        driver: "local"
    caddy:
        driver: "local"
    elasticsearch-data:
        driver: "local"
    elasticsearch-plugins:
        driver: "local"
    sessions:    ## nothing is connected to this (- ./data/sessions:/sessions)
        driver: "local"

nginx.conf:

user www-data;
worker_processes 4;
pid /run/nginx.pid;
daemon off;

events {
  worker_connections  2048;
  multi_accept on;
  use epoll;
}

http {
  server_tokens off;
  sendfile on;
  tcp_nopush on;
  tcp_nodelay on;
  keepalive_timeout 15;
  types_hash_max_size 2048;
  client_max_body_size 20M;
  include /etc/nginx/mime.types;
  default_type application/octet-stream;
  access_log /var/log/nginx/access.log;
  error_log /var/log/nginx/error.log;
  gzip on;
  gzip_disable "msie6";
  include /etc/nginx/conf.d/*.conf;
  include /etc/nginx/sites-available/*;
  open_file_cache max=100;
  charset UTF-8;
}

default.conf: (local.flashalight.com) is my custom domain which I also set up in my /etc/hosts file to point towards 127.0.0.1

server {

    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    server_name local.flashalight.com;
    root /var/www/public;
    index index.php index.html index.htm;

    location / {
         try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
        try_files $uri /index.php =404;
        fastcgi_pass php-upstream;
        fastcgi_index index.php;
        fastcgi_buffers 16 16k; 
        fastcgi_buffer_size 32k;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }
}

@winfried-van-loon
Copy link
Contributor

@nckrtl I may have two possible solutions you can try.

The first is stopping any webserver you've got running on your mac. They may be inside any application you've got installed. Visit http://localhost and try to find out what gets served.

Note that MacOS has an Apache webserver installed by default. Use the following commands to stop it:

sudo apachectl stop

or

sudo apachectl -k stop

The other possible solution:
If you have no other Docker containers running other than Laradock, you may try the following.

Docker has this cool "Reset to factory defaults" option, as shown below.

Please, be aware that this will remove all your containers, volumes. For example, databases within the docker containers. Make backups and export important databases if needed.

screen shot 2017-04-11 at 13 51 53

If possible, could you try resetting your Docker, then try cloning Laradock to a fresh directory on your Mac and try if the issue is still there? We've done a lot of enhancements and changes to Laradock since the issue was opened.

@sl5310
Copy link

sl5310 commented Jul 27, 2017

facing the same issue This site can’t be reached

@connor11528
Copy link

I am also getting this same error when running laradock. Are there any updates on a fix for getting the server running?

Install everything:

docker-compose up -d nginx mysql redis 
Creating network "laradock_default" with the default driver
Creating network "laradock_frontend" with driver "bridge"
Creating network "laradock_backend" with driver "bridge"
Creating laradock_redis_1 ... 
Creating laradock_applications_1 ... 
Creating laradock_mysql_1 ... 
Creating laradock_redis_1
Creating laradock_applications_1
Creating laradock_applications_1 ... done
Creating laradock_mysql_1 ... done
Creating laradock_workspace_1 ... done
Creating laradock_php-fpm_1 ... 
Creating laradock_php-fpm_1 ... done
Creating laradock_nginx_1 ... 
Creating laradock_nginx_1 ... done

But when I go to http://localhost I get The site can't be reached error

@woutervu
Copy link

woutervu commented Jan 4, 2018

I pulled laradock yesterday and ran into the same issue on Windows 10. While spinning up my containers it would list Nginx:

$ docker-compose up -d nginx mysql
Starting laradock_mysql_1 ...
Starting laradock_applications_1 ...
Starting laradock_mysql_1
Starting laradock_applications_1 ... done
Starting laradock_workspace_1 ...
Starting laradock_workspace_1 ... done
Starting laradock_php-fpm_1 ...
Starting laradock_php-fpm_1 ... done
Starting laradock_nginx_1 ...
Starting laradock_nginx_1 ... done

But the nginx container would not show up in the list (docker ps). I checked with netstat if anything was hogging the ports, switched up the Nginx ports just to be sure, but no cigar. I reset docker to factory defaults, setup my shared drives BEFORE spinning up any containers and tried again. Nginx container is running now.

I have no idea what may have caused this though.

@kichetof
Copy link

kichetof commented Jan 7, 2018

Same issue here (Docker version 17.05.0-ce run on Synology NAS with DSM 6.1.4-15217 Update 5)

$ docker-compose up -d nginx mysql
Creating network "laradock_default" with the default driver
Creating network "laradock_frontend" with driver "bridge"
Creating network "laradock_backend" with driver "bridge"
Creating laradock_applications_1 ...
Creating laradock_mysql_1 ...
Creating laradock_applications_1
Creating laradock_applications_1 ... done
Creating laradock_mysql_1 ... done
Creating laradock_workspace_1 ... done
Creating laradock_php-fpm_1 ...
Creating laradock_php-fpm_1 ... done
Creating laradock_nginx_1 ...
Creating laradock_nginx_1 ... done

nginx start and stop unexpectedly (from command or Docker GUI; but no log anywhere).

My .env differences:

$ diff -f env-example .env
c8
APPLICATION=../test/
c23
DATA_SAVE_PATH=/volume1/docker/laradock/data
c36
DOCKER_HOST_IP=172.17.0.1
c126 127
NGINX_HOST_HTTP_PORT=8081
NGINX_HOST_HTTPS_PORT=8082

I runned nginx:alpine manually from Docker GUI and it works fine. Maybe a bug in the Dockerfile from laradock ?

@kichetof
Copy link

kichetof commented Jan 8, 2018

I found some logs:

2018/01/08 21:44:20 [emerg] 1#1: invalid port in upstream ":" in /etc/nginx/conf.d/upstream.conf:1

It seems that Dockerfile doesn't contain ENV after ARG, like:

ARG PHP_UPSTREAM_CONTAINER=php-fpm
ENV PHP_UPSTREAM_CONTAINER ${PHP_UPSTREAM_CONTAINER}
ARG PHP_UPSTREAM_PORT=9000
ENV PHP_UPSTREAM_PORT ${PHP_UPSTREAM_PORT}

Now nginx start :)

@aissasell
Copy link

Note it as solved and update the repository 😂

@stale
Copy link

stale bot commented Feb 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Feb 2, 2020
@stale
Copy link

stale bot commented Feb 23, 2020

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants