Skip to content

shockz Blog개발과 기술, 그리고 경험을 공유합니다

VitePress로 만든 개인 기술 블로그

📝 최신 글

Vue.js 관련

Vue.js ​ Nginx + Vue.js 배포를 위한 설정Step 1. 기본 위치 설정Step 2. certbot 을 통한 인증서 생성 Nginx + Vue.js 배포를 위한 설정 ​ Step 1. 기본 위치 설정 ​ target server: linux (centos 8) 배포 방식: docker-compose 를 이용한 nginx container bash# 배포 디렉토리 $ mkdir dist # certbot 인증서 저장경로 $ mkdir certbot-etc # nginx config $ mkdir nginx-conf dist : vue app 빌드한 결과를 여기에 넣고 호스팅하기 위한 디렉토리 certbot-etc : letsencrypt 인증서 저장 디렉토리 nginx-conf : nginx config 디렉토리 Step 2. certbot 을 통한 인증서 생성 ​ 인증서 생성만을 위한 nginx.conf 작성 bashserver { listen 80; listen [::]:80; server_name temp.temp.io; index index.html index.htm; root /var/www/html; location ~ /.well-known/acme-challenge { allow all; root /var/www/html; } location / { try_files $uri $uri/ /index.html; } location ~ /\.ht { deny all; } location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { log_not_found off; access_log off; allow all; } location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ { expires max; log_not_found off; } } docker-compose.yml 를 통해 인증서 생성 시작 ymlversion: '3' services: certbot: depends_on: - webserver image: certbot/certbot volumes: - ./certbot-etc:/etc/letsencrypt - ./dist:/var/www/html command: certonly --webroot --webroot-path=/var/www/html --email temp@gmail.com --agree-tos --no-eff-email --staging -d temp.temp.io webserver: image: nginx:alpine restart: unless-stopped ports: - "80:80" - "443:443" volumes: - ./dist:/var/www/html - ./nginx-conf:/etc/nginx/conf.d - ./certbot-etc:/etc/letsencrypt networks: - app-network volumes: certbot-etc: dist: nginx-conf: networks: app-network: driver: bridge TIP certbot 의 --staging 은 테스트 한다는 의미 email, domain 은 적절하게 수정 bash$ docker-compose up -d Name Command State Ports

Released under the MIT License.