0

GCP 버킷에 create-react-app 빌드 (app.yaml 파일 사용)를 업로드했습니다. 앱은 클라우드 셸을 사용하여 App Engine 인스턴스에 배포되었습니다.Google Cloud Platform에 create-react-app 빌드를 배포 한 후 URL을 찾을 수 없습니다.

앱의 루트 URL로 이동하면 정상적으로 작동합니다. 그러나 example.com/anything에가는 것은 다음과 같은 오류를 반환

Error: Not Found

The requested URL /anything was not found on this server.

애플리케이션 제목 파일은 다음과 같다 :

runtime: python27 
api_version: 1 
threadsafe: true 
handlers: 
- url: /(.*\.(html|css|js)) 
    static_files: build/\1 
    upload: build/(.*\.(html|css|js)) 

- url:/
    static_files: build/index.html 
    upload: build/index.html 
+1

두 번째 처리기에'url :. *'을 사용하십시오. – norbertpy

답변

1

당신은 /anything에 대한 처리기가 없습니다. 당신이 정적 파일로 그들에게 anything.html를 제공하여 build 디렉토리에 넣어, 그리고 /anything.html로 이동하려는 경우,

- url: /.* 
    static_files: build/index.html 
    upload: build/index.html 

나 : 당신이 포괄 URL을 원하는 경우, 정규식 타입 핸들러를 사용합니다. 첫 번째 처리기가 해당 URL을 매핑하도록 설정됩니다.

관련 문제