Pos

Nginx Webserver

Fungsi

NGINX adalah open source webserver, reverse proxying, caching, load balancing, media streaming dan banyak lagi. Ianya stabil dan berprestasi tinggi.

Environment

  • Ubuntu 22.04 LTS
  • Docker 20.10.12

Install docker

1
2
sudo apt install docker.io
sudo apt install docker-compose

Bina folder

1
2
mkdir nginx
cd nginx

Bina docker-compose.yaml file

1
touch docker-compose.yaml

Edit docker-compose.yaml file

1
nano docker-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
version: '3'

services:
  nginx:
    image: nginx:latest
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./src:/usr/share/nginx/html

Run docker-compose

1
sudo docker-compose up -d

Docker run untuk mempercepatkan proses

1
docker run --name nginx -v $(pwd):/usr/share/nginx/html:ro -d -p 80:80 nginx:latest 

Layari webserver

http://localhost:80

Pos ini dilesenkan di bawah CC BY 4.0 oleh penulis.