Created
August 25, 2016 13:17
-
-
Save DeRain/80c6290de575a69154497efcd3cbae38 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class UniusHttpRequest extends CHttpRequest | |
{ | |
/** | |
* @var string Redirect path, should be configured in nginx virtual host | |
* @link http://kovyrin.net/2010/07/24/nginx-fu-x-accel-redirect-remote/ | |
*/ | |
public $outerRedirectUrl = '/outer_redirect'; | |
/** | |
* @param string $outerUrl | |
*/ | |
public function outerRedirect($outerUrl) | |
{ | |
# This header will ask Nginx to get this url | |
header('X-Accel-Redirect: ' . $this->outerRedirectUrl . '/' . urldecode($outerUrl)); | |
Yii::app()->end(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment