Local domain cannot be used with NGINX (Docker/Container)

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
wmcig
Posts: 16
Joined: Wed Aug 25, 2021 12:17 pm

Re: Local domain cannot be used with NGINX (Docker/Container)

Post by wmcig »

Joulinar wrote: Fri Oct 08, 2021 11:08 am I guess you need to use phpfpm.local:8080
This is not working. Site was not found by browser.
User avatar
Joulinar
Posts: 5998
Joined: Sat Nov 16, 2019 12:49 am

Re: Local domain cannot be used with NGINX (Docker/Container)

Post by Joulinar »

did you tried to change port number on your container to have Nginx LISTEN on port 80 and move PiHole to something like 81?

BTW: this is not working as well? http://phpfpm.local:8080/

I did a test using a Nginx docker container and on my demo system I got Nginx welcome page correctly
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
wmcig
Posts: 16
Joined: Wed Aug 25, 2021 12:17 pm

Re: Local domain cannot be used with NGINX (Docker/Container)

Post by wmcig »

Joulinar wrote: Fri Oct 08, 2021 11:27 am did you tried to change port number on your container to have Nginx LISTEN on port 80 and move PiHole to something like 81?

BTW: this is not working as well? http://phpfpm.local:8080/

I did a test using a Nginx docker container and on my demo system I got Nginx welcome page correctly
:? Maybe I have to reinstall a Nginx Container. Please Tell me which image do you have used.
User avatar
Joulinar
Posts: 5998
Joined: Sat Nov 16, 2019 12:49 am

Re: Local domain cannot be used with NGINX (Docker/Container)

Post by Joulinar »

I simply used the official container nginx
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
wmcig
Posts: 16
Joined: Wed Aug 25, 2021 12:17 pm

Re: Local domain cannot be used with NGINX (Docker/Container)

Post by wmcig »

I installed a new nginx container and have done all the info of the workshop I linked to it in my first posting.

Now the terminal output told me the following:

Code: Select all

web_1  | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
web_1  | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
web_1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
web_1  | 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
web_1  | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
web_1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
web_1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
web_1  | /docker-entrypoint.sh: Configuration complete; ready for start up
web_1  | 2021/10/10 14:31:02 [notice] 1#1: using the "epoll" event method
web_1  | 2021/10/10 14:31:02 [notice] 1#1: nginx/1.21.3
web_1  | 2021/10/10 14:31:02 [notice] 1#1: built by gcc 8.3.0 (Debian 8.3.0-6) 
web_1  | 2021/10/10 14:31:02 [notice] 1#1: OS: Linux 5.10.60-v7l+
web_1  | 2021/10/10 14:31:02 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
web_1  | 2021/10/10 14:31:02 [notice] 1#1: start worker processes
web_1  | 2021/10/10 14:31:02 [notice] 1#1: start worker process 30
web_1  | 2021/10/10 14:31:02 [notice] 1#1: start worker process 31
web_1  | 2021/10/10 14:31:02 [notice] 1#1: start worker process 32
web_1  | 2021/10/10 14:31:02 [notice] 1#1: start worker process 33
web_1  | 2021/10/10 14:32:53 [error] 30#30: *1 "/var/www/html/index.html" is not found (2: No such file or directory), client: 192.168.178.44, server: phpfpm.local, request: "GET / HTTP/1.1", host: "192.168.178.42:8080"
web_1  | 192.168.178.44 - - [10/Oct/2021:14:32:53 +0000] "GET / HTTP/1.1" 404 153 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0"
Before I changed the docker-compose.yml file to the following:

Code: Select all

web:
    image: nginx:latest
    ports:
        - "8080:80"
    volumes:
        - ./src:/src
        - ./default.conf:/etc/nginx/conf.d/default.conf
The following folder are existing: /var/www.

"html" folder was not found!

I don´t know what is wrong with the installation? Why was the "html" folder not created automatically?
User avatar
Joulinar
Posts: 5998
Joined: Sat Nov 16, 2019 12:49 am

Re: Local domain cannot be used with NGINX (Docker/Container)

Post by Joulinar »

Well the container is not going to create folder on the host system. You would need to ensure they exist before starting the contain. Something you would need to do yourself.

Still I think using docker is useless overhead. You could run Nginx together with Pihole directly on your DietPi system. Our install script would take care on everything to get both up and running without any user configuration needed. But as you prefer using docker, all configuration steps need to be done by yourself.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
wmcig
Posts: 16
Joined: Wed Aug 25, 2021 12:17 pm

Re: Local domain cannot be used with NGINX (Docker/Container)

Post by wmcig »

Could you please give me more information about the way your software is working , like you described in your last posting? Maybe any links?
User avatar
Joulinar
Posts: 5998
Joined: Sat Nov 16, 2019 12:49 am

Re: Local domain cannot be used with NGINX (Docker/Container)

Post by Joulinar »

What do you mean exactly? You mean our script dietpi-software? Basically it's going to install request software from official sources and do all needed configuration steps to ensure compatibility between different apps. Basically you could have a look to our online docs. There we describe a little bit our scripts as well as software title. https://dietpi.com/docs/
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply