일반 웹호스팅에서는 동작하는데, 제가 만든 VPS 서버에서는 위 코드가 동작하지 않습니다.

 

동작하지 않는 서버의 php 정보

http://eond.com/misc/phpinfo.php

 

동작하는 서버의 php 정보

http://fun.eond.com/misc/phpinfo.php

 

동작하는 서버의 주소

1) http://fun.eond.com/market_mystore

2) 상단바의 로그인 버튼을 클릭합니다.

3) http://fun.eond.com/login 으로 이동합니다.

4) 아이디 : [email protected] / 비밀번호 : test

5) http://fun.eond.com/market_mystore 로 자동으로 이동합니다.

 

동작하지 않는 서버의 주소

1) http://eond.com/market_mystore

2) 상단바의 로그인 버튼을 클릭합니다.

3) http://eond.com/login 으로 이동합니다.

4) 아이디 : [email protected] / 비밀번호 : test

5) http://eond.com/market_mystore 로 자동으로 이동하지 않습니다.

 

무슨 차이일까요?

 

해당 코드는 아래와 같습니다.

<form action="{getUrl()}" method="post" ruleset="@login">
<input type="hidden" name="act" value="procMemberLogin" />
<input type="hidden" name="success_return_url" value="<? echo  htmlspecialchars( $_SERVER['HTTP_REFERER'] ); ?>" />
   <fieldset class="login_form">
   <legend>로그인</legend>
   <div class="error" cond="$XE_VALIDATOR_MESSAGE">{$XE_VALIDATOR_MESSAGE}</div>
   <div class="input_row" id="id_area">
      <span class="input_box">
         <label for="ididid" id="label_id_area" class="lbl">아이디</label>
         <input type="email" id="id" name="user_id" accesskey="l" placeholder="이메일" class="int" required="true">
      </span>
      <button type="button" title="delete" id="id_clear" class="wrg" style="display:none" onclick="inputReset('id')">삭제</button>
   </div>
   <div id="err_empty_id" class="error" style="display:none;">아이디를 입력해주세요.</div>

   <div class="input_row" id="pw_area">
      <span class="input_box">
         <label for="pw" id="label_pw_area" class="lbl" >비밀번호</label>
         <input type="password" id="pw" name="password" placeholder="비밀번호" class="int" maxlength="16" required="true">
      </span>
      <button type="button" title="delete" id="pw_clear" class="wrg" style="display:none" onclick="inputReset('pw')">삭제 </button>
   </div>
   <div id="err_empty_pw" class="error" style="display:none;">비밀번호를 입력해주세요.</div>

   <div class="loginbox">
      <input type="submit" id="btn_login" class="btn-login" accesskey="s" value="로그인">
   </div>
   <div class="check_info">
   <div class="login_check">
      <span class="login_check_box">
         <input type="checkbox" id="keep_login" name="keep_signed" value="Y" onchange="savedLong(this);">
         <label for="keep_login" id="label_login_chk" class="sp">로그인 상태 유지</label>
      </span>
      <div class="ly_v2" id="persist_usage" style="display:none;"><div class="ly_box"><p>개인정보 보호를 위해 <strong>개인 PC에서만 사용하세요.</strong>&nbsp;&nbsp;<a target="_blank" href="https://help.naver.com/support/contents/contents.nhn?serviceNo=532&amp;categoryNo=1523" class="sp btn_check_help">도움말보기</a></p></div><span class="sp ly_point"></span></div>
   </div>
</div>
   </fieldset>
</form>
  • profile
    엔진땜에 그런거 같은데요
  • profile profile
    Nginx 때문에 그런가요? 혹시 수정할 방법은 없을까요. 적용할 수 있게끔?;
  • profile profile
    $_SERVER['HTTP_REFERER']
    꼭 이렇게 적어주지 않아도,
    <input type="hidden" name="success_return_url" value="{getUrl('','mid','market_layout')}">
    이렇게 적어줘도 안됩니다.
  • profile profile
    머리아프네요,구조를 바꿔야 할수도 있어요.
  • profile
    <? echo 이런 코드는 XE에서 지향합니다.

    getUrl 같은 자체 주소를 사용하시면되요. 만약 그래도 안먹힌다면 해당 액션을 실행하는 곳에서 강제적으로 작업이 끝난다음 리턴을 시키는 경우이거나 필터를 사용하는것이거나요.

    procMemberLogin 의 경우 보통 자동으로 리턴URL설정을 넣는다 하더라도 맴버 설정변수를 사용하고 있어요.
    if(!$config->after_login_url)
    {
    $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '');
    }
    else
    {
    $returnUrl = $config->after_login_url;
    }
    기본적으로는 success_return_url 을 사용하고 잇긴하네요 :)

    $config->after_login_url 설정이 되어잇지 않은지도 한번 살펴보시고요.
  • profile profile
    <? echo 이런 코드를 사용하지 않더라도
    {getUrl('','mid','market_mystore')}
    이런 식으로 value 값을 넣어줘도 안됩니다.

    success_return_url 을 설정해서 로그인할 때 로그인 버튼을 누르면 로그인함과 동시에 해당 value 값으로 넘어가도록 설정한 코드인데요, 위 두 주소 모두 코드나 설정값은 동일한데,
    서버의 사양만 다릅니다.

    아파치,php7/Nginx,php7.0-fpm 인데요. 무슨 설정 때문에 그런 건지 모르겠네요;