# File not find 2024/07/02 10:49:14 \[error\] 21#21: \*1 open() "/usr/share/nginx/html/

**URL:** <https://community.letsencrypt.org/t/file-not-find-2024-07-02-1014-error-21-21-1-open-usr-share-nginx-html/221115>\
**Category:** Help\
**Created:** [July 2, 2024, 10:55am UTC](https://community.letsencrypt.org/t/file-not-find-2024-07-02-1014-error-21-21-1-open-usr-share-nginx-html/221115 "2024-07-02T10:55:55Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![langbach364](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/langbach364/32/81120_2.png) [@langbach364](https://community.letsencrypt.org/u/langbach364)\
**Post date:** [July 2, 2024, 5:33pm UTC](https://community.letsencrypt.org/t/file-not-find-2024-07-02-1014-error-21-21-1-open-usr-share-nginx-html/221115/21 "2024-07-02T17:33:32Z")

</div>

```nohighlight
services:
  helloworld:
    container_name: helloworld
    image: crccheck/hello-world

  nginx:
    image: nginx:latest
    container_name: nginx
    restart: always
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
      - ./certbot/conf:/etc/letsencrypt
      - ./certbot/www:/var/www/certbot
      - ./nginx/logs:/var/log/nginx
    tty: true
    stdin_open: true
    healthcheck:
      test: ["CMD", "nginx", "-t"]
      interval: 30s
      timeout: 10s
      retries: 3

  certbot:
    image: certbot/certbot
    container_name: certbot
    volumes:
      - ./certbot/conf:/etc/letsencrypt
      - ./certbot/www:/var/www/certbot
      - ./certbot/logs:/var/log/letsencrypt
    command: certonly --webroot -w /var/www/certbot --non-interactive --email bachlang364@gmail.com -d sieunhan.langbach.io.vn --agree-tos --dry-run

networks:
  default:
    name: my_network

```

> here is my docker configuration from yml file

```nohighlight
worker_processes auto;
worker_cpu_affinity auto;

events {
    multi_accept on;
    worker_connections 1024;
}

http {
    charset utf-8;
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    server_tokens off;
    log_not_found off;
    types_hash_max_size 4096;
    client_max_body_size 16M;
    types_hash_bucket_size 128;
    keepalive_timeout 65;
    include mime.types;
    default_type application/octet-stream;
    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log warn;
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
    server_tokens off;
    charset utf-8;

    server {
        listen 80;
        listen [::]:80;
        server_name sieunhan.langbach.io.vn;

        access_log /var/log/nginx/access_80.log combined;

        location /.well-known/acme-challenge/ {
            allow all;
            root /var/www/certbot;
        }

        location / {
            return 301 https://$host$request_uri;
        }
    }

    server {
        listen 443 ssl;
        server_name sieunhan.langbach.io.vn;

        ssl_certificate /etc/letsencrypt/live/sieunhan.langbach.io.vn/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/sieunhan.langbach.io.vn/privkey.pem;

        root /var/www/html;
        index index.php index.html index.htm;

        location / {
            proxy_pass http://helloworld:8000/;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
        location /.well-known/acme-challenge/ {
            allow all;
            root /var/www/certbot;
        }
    }
}

```

> Here is the configuration file from my nginx.conf

```nohighlight
${DIR}
├── docker-compose.yml
│
├── nginx/
│ ├── nginx.conf

```

---

<div class="post-metadata">

**Author:** ![MikeMcQ](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mikemcq/32/52772_2.png) [@MikeMcQ](https://community.letsencrypt.org/u/MikeMcQ)\
**Post date:** [July 2, 2024, 6:13pm UTC](https://community.letsencrypt.org/t/file-not-find-2024-07-02-1014-error-21-21-1-open-usr-share-nginx-html/221115/22 "2024-07-02T18:13:38Z")

</div>

Sorry, not a docker expert. Just know enough to understand how it works

Maybe someone else will help out. Or, try a docker forum

Your nginx is not seeing HTTP requests. That isn't unique to Let's Encrypt. It's a general server setup problem.

---

<div class="post-metadata">

**Author:** ![langbach364](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/langbach364/32/81120_2.png) [@langbach364](https://community.letsencrypt.org/u/langbach364)\
**Post date:** [July 2, 2024, 6:40pm UTC](https://community.letsencrypt.org/t/file-not-find-2024-07-02-1014-error-21-21-1-open-usr-share-nginx-html/221115/23 "2024-07-02T18:40:29Z")

</div>

Thank you for your dedicated help me

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)\
**Post date:** [August 1, 2024, 6:41pm UTC](https://community.letsencrypt.org/t/file-not-find-2024-07-02-1014-error-21-21-1-open-usr-share-nginx-html/221115/24 "2024-08-01T18:41:08Z")

</div>

Closed on August 1, 2024, 6:41pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

[Previous page](https://community.letsencrypt.org/t/file-not-find-2024-07-02-1014-error-21-21-1-open-usr-share-nginx-html/221115.md?page=1)
