will request_uri get passed from cookieless server to 403 page on main server?

Ian Evans ianevans at digitalhit.com
Tue Nov 19 09:13:30 UTC 2013

On 18/11/2013 6:26 PM, Francis Daly wrote:

Thanks for your response.

> (You can possibly avoid that if you use something like
> .../dhe403.shtml/$request_uri and handle it appropriately on the far
> side.)


> It would seem easier to either proxy_pass or fastcgi_pass to the old
> server, in an error_page 403 location on the new server, if you're happy
> to have that level of not-just-static involved (and not happy to run
> the full php suite on the new server).
> That way, the browser would get one redirect to the intended destination
> instead of one to an intermediate location first.

Just to clarify, the two "servers" are on same physical box with the 
same document root, just migrating to a better host. So php is 
installed. I'm just creating two server blocks so that the images will 
be served on a cookieless sub-domain for web performance reasons, i.e.:

server {
server_name www.example.com;

server {
server_name static.example.com;

On the www block, I currently have this 403 block:

error_page 403 = /dhe403.shtml;
location = /dhe403.shtml {
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_cache  off;

So I could add that to my static block as well?

Also, I'd have this "rewrite anything not static" location in the static 

if ($request_uri !~* 
rewrite ^(.*) http://www.example.com$1 permanent;

If I put the 403 location before it, will it still redirect any 
non-static files EXCEPT for the dhe403.shtml?


More information about the nginx mailing list