2011-11-04 2 views
1

lighttpd와 apache에서 동일한 코드가 제대로 작동하고 있었고, 최근에 nginx로 전환했고 응용 프로그램을 로컬에서 실행할 때 충돌이 발생했습니다. 그러나 브라우저 내에서 동일한 코드로 실행됩니다. 다음은 서버에 요청하는 소스 코드입니다.URLRequest to nginx server crashes

public function ApiCall(methodName:String,params:Object=null) 
{ 
     super(); 

     url.method = URLRequestMethod.POST; 

     var variables:URLVariables = new URLVariables(); 


     variables.call = methodName; 

     variables.params = JSON.encode(params); 

     url.data = variables; 

     this.dataFormat = URLLoaderDataFormat.TEXT; 

     this.addEventListener(Event.COMPLETE, onLoadComplete); 
     this.addEventListener(IOErrorEvent.IO_ERROR, onLoadError); 
} 

public function post():void 
{ 
     try 
     { 
      this.load(url); 
     } 
     catch (e:Error) 
     { 
      trace("Error Message : " + e.message); 
     } 

     // debug 
     trace(url.data.call + " Params : " + url.data.params); 
} 

플래시 플레이어가 아무런 의미없는 오류 메시지없이 충돌합니다.

PHP 쪽을 검사했는데 어떤 이유로 $ _POST 배열이 비어 있습니다.

아이디어가 있으십니까?

답변

1

문제는 http 요청을 만드는 데 사용 된 URL로, 내가 as3 코드에서 http://www.domain.com을 사용하고 있었고 도메인과 다시 쓰기 규칙은 http://domain.com인데, 어떻게 든이 요청을 위반했습니다.

AS3의 URL에서 www를 제거하면 문제가 해결됩니다.

+0

+1 이것은 많은 사람들에게 일어날 것이라고 확신합니다 - 좋은 질문/답변. – Marty