Laravel Forge로 vue nuxt를 배포하는 방법 #deploy #deployment #nuxt #vue

# 무엇?

Laravel Forge를 사용하여 vue nuxt 프로젝트를 배포하는 방법

# 어떻게?

– 프로젝트 생성

- proejct Type은 "State HTML"
- web Directory는 "/"로 설정 (advanced로 선택해야 보임)

– Resosity 연결(작성기 설치 옵션 비활성화)

– SSL 설정(ssl 탭 -> 암호화하자)

– ngnix 설정(위치를 변경해야 함/{})

    location / {
        # try_files $uri $uri/ /index.php?$query_string;
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    
        # 액세스 제어 지시어 추가
        allow all;
        # 불필요한 액세스 제한
        deny all;
    }

– 명령 탭에서 다음 명령을 실행합니다(이 작업을 수행할 필요가 없을 수도 있습니다).

npm run generate

– 배포 스크립트 변경

npm install
npm run build
pm2 restart all