Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Upstream: support named location for X-Accel-Redirect

November 10, 2014 04:10AM
On 10 Nov 2014, at 03:54, Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp> wrote:

> (2014/11/08 0:59), Igor Sysoev wrote:
>> On 04 Nov 2014, at 14:18, Toshikuni Fukaya <toshikuni-fukaya@cybozu.co.jp> wrote:
>>
>>> Upstream: support named location for X-Accel-Redirect.
>>
>> Could please you provide usage examples?
>>
>>
>
> Here is my (simplified) config:
>
> server {
> location / {
> proxy_pass http://app;
> }
>
> location @contents {
> proxy_pass http://contents/$upstream_http_x_contents_url;
> }
> }
>
> app is a upstream application server, it processes all client requests.
> contents is a some of blob server (like as S3) to supply images, css and so on.
>
> When clients access to nginx, app will check a some of ACL to such requests, then reply with x-accel-redirect and x-contents-url headers.
> Finally, nginx will return a content from contents upstream.
> In this time, x-accel-redirect will be set to @contents and x-contents-url will be an appropriate content url.
>
> The key of this strategy is that all requests is passed to app and can be checked by it.
> If location @contents is a normal location such as /contents, a client request to /contents will not be passed app. It is not comfortable for me.

The "/contents” location can be marked as "internal", and it can not be accessed outside directly.
However, using named location is more convenient for this example. Thank you.


--
Igor Sysoev
http://nginx.com

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Upstream: support named location for X-Accel-Redirect

Toshikuni Fukaya 694 November 04, 2014 06:20AM

Re: [PATCH] Upstream: support named location for X-Accel-Redirect

Igor Sysoev 724 November 07, 2014 11:02AM

Re: [PATCH] Upstream: support named location for X-Accel-Redirect

Toshikuni Fukaya 371 November 09, 2014 07:56PM

Re: [PATCH] Upstream: support named location for X-Accel-Redirect

Valentin V. Bartenev 431 November 10, 2014 03:44AM

Re: [PATCH] Upstream: support named location for X-Accel-Redirect

Igor Sysoev 915 November 10, 2014 04:10AM

Re: [PATCH] Upstream: support named location for X-Accel-Redirect

Maxim Dounin 385 November 10, 2014 01:04PM

Re: [PATCH] Upstream: support named location for X-Accel-Redirect

Toshikuni Fukaya 392 November 10, 2014 07:34PM

Re: [PATCH] Upstream: support named location for X-Accel-Redirect

Maxim Dounin 430 November 11, 2014 09:04AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 155
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready