인프런 커뮤니티 질문&답변

157350님의 프로필 이미지

작성한 질문수

따라하며 배우는 노드, 리액트 시리즈 - 레딧 사이트 만들기(NextJS)(Pages Router)

Client 실행

3000번은 잘 들어가지는데 80번은 안됩니다.

24.05.28 05:37 작성

·

146

1

sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000
까지 하고

3000번 포트로 잘 들어가지는데 3000번포트를 지우고 들어가봐도 뒤에 :80을 붙여 넣어 들어가봐도 사이트에 연결할 수 없음이 뜨네요 왜 그럴까요??

답변 1

0

157350님의 프로필 이미지
157350
질문자

2024. 05. 28. 05:57

AWS사이트 EC2 Instance Connect에서는
The "images.domains" configuration is deprecated. Please use "images.remotePatterns" configuration instead.

For production Image Optimization with Next.js, the optional 'sharp' package is strongly recommended. Run 'npm i sharp', and Next.js will use it automatically for Image Optimization.

이런 오류가 나는데요
1번 images.domains 이게 더 이상 사용되지않는다고하여

스택 오버플로우에

images: {
    remotePatterns: [
        {**strong text**
            protocol: 'https',
            hostname: 'i.ibb.co',
            pathname: '**',
        },
        {
            protocol: 'https',
            hostname: 'lh3.googleusercontent.com',
            pathname: '**',
        },
        {
            protocol: 'https',
            hostname: 'daisyui.com',
            pathname: '**',
        },
    ],
}, };

이런식으로 바꾸라길래 저는

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  images: {
    remotePatterns: [
      {
        protocol: 'https',
        hostname: 'www.gravatar.com',
        pathname: '**', // 모든 경로 허용
      },
      {
        protocol: 'http',
        hostname: 'localhost',
        pathname: '**', // 모든 경로 허용
      },
      {
        protocol: 'http',
        hostname: 'ec2-3-34-91-234.ap-northeast-2.compute.amazonaws.com',
        pathname: '**', // 모든 경로 허용
      },
    ],
  },
};

export default nextConfig;

이런식으로 바꾸어서 해도 안되고
2번 sharp가 누락이 된 것 같다고 하여서 두번이나 재 설치 해줬습니다. client 파일에 정확히...
그래도 안되네요 제가 뭐가 문제가 있는걸까요
현재는 next.config.js파일은 강의대로 돌려놓았습니다...
3000번 포트는 잘 들어가지고 80번만 안되네요

157350님의 프로필 이미지

작성한 질문수

질문하기