3. Cài nginx proxy manager

// Cài đặt nano để sửa file
apt install nano

// Tạo thư mục chứa docker file của nginx proxy manager (mình tạo ở /home/nginx)
mkdir /home/nginx
cd /home/nginx
nano docker-compose.yaml
// Sao chép đoạn này vào file
version: '3.8'
services:
  app:
    container_name: nginx-proxy
    image: 'jc21/nginx-proxy-manager:latest'
    restart: always
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
    network_mode: bridge

// ctrl + o 
// enter 
// để lưu file
// ctrl + x để thoát

Sau khi chạy xong, vào portainer sẽ thấy nginx proxy manager đã được deploy

Nginx proxy manager đã deploy

Chúng ta vào http://localhost:81/ để vào dashboard kiểm tra (thay localhost thành ip của vsp) Tài khoản mặc định là - username: [email protected] - password: changeme

Nginx proxy manager dashboard

Nginx proxy manager cũng hỗ trợ SSL Let's Encrypt hoặc bạn có thể tự thêm thêm ssl của mình vào đây

Thêm custom ssl

Last updated

Was this helpful?