2012-09-02 3 views
3

http://website.com/some_dir/과 같이 "/"로 끝나는 URL에 대한 요청을 받고 싶습니다. 내 디렉토리에 index.html 파일을 수신하려면 ... 내 예제에서는 http://website.com/some_dir/index.html을 받아야합니다.Google 앱 엔진 yaml index.html

나는 그것이 GAE 런처/로컬 서버와 로컬 작업이 ...하지만 난 그것과 website.appspot.com 통한 액세스를 배포 할 때 그것은 내가 오류가 좀 .. 실패

Error: Not Found

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

- url:/
    static_files: staticLocation/index.html 
    upload: staticLocation/index.html 
- url: (.+)/ 
    static_files: staticLocation/\1/index.html 
    upload: staticLocation 
- url:/
    static_dir: staticLocation 

내가 로컬 잘 작동하는 이유/방법에 관해서 궁금 해요,하지만에 appspot ... 아이디어, 어떻게 내 문제를 해결하지 :

이 난 내 YAML에있는 무엇인가?

답변

-1

AppEngine 프로덕션 서버는 대소 문자를 구분하는 파일 시스템이므로 대소 문자가 모두 일치하는지 확인하십시오.

0

두 번째 경로에 대한 '업로드'행이 충분하지 않아 내부의 파일이 appengine에 배포되지 않습니다. 당신은 뭔가를 원하는 :

- url: (.+)/ 
    static_files: staticLocation/\1/index.html 
    upload: staticLocation/(.*) 

- url: /(.+) 
    static_files: staticLocation/\1/index.html 
    upload: staticLocation/(.+)/index.html 

(귀하의 마지막 경로가 처음과 동일한 URL을 가지고, 그래서 결코 공격 할 않을 것 제거 할 수 있습니다.)

0

나는이 문제를 확인했습니다. 로컬에서는 작동하지만 appspot에서는 작동하지 않습니다. 문제의 변화 해결하려면 :

- url: (.+)/ 
    static_files: staticLocation/\1/index.html 

- url: (.*)/ 
    static_files: staticLocation\1/index.html` 

에와 제대로 작동합니다. (참고 : static_files+url*로 변경하고 /가 제거)

당신이 일치 된 당신의 호기심을 만족시키기는 선행 / 때문에 파일 시스템 위치 조회가 staticlocation//some_dir/index.html했다 당신의 파일 시스템에서 잘 작동하는 //는 아래로 붕괴하기 때문에 귀하의 OS에서 단지 /입니다. 나는 appspot의 경로 검색이 //을 붕괴시키지 않아 index.html 파일을 찾지 못한다고 추정합니다.

아, 그런데 제가 언급 한 것처럼 두 번째 규칙을 수정하면 규칙이 제거 될 수 있도록 첫 번째 규칙이 전혀 필요하지 않게됩니다.