auth_request with vhost conf files

lsces nginx-forum at forum.nginx.org
Mon Apr 6 21:31:32 UTC 2020


After a few false starts I've got auth_request passing parameters to php-fpm
and my firebird database is allowing control of access to files in the
storage filing system. Somewhat defeats the "This is cool because no php is
touched for static content" and I have had to produce a slimline version of
the access control but it works well with the dynamic pages.

Problem is this is all working on a single site http setup and when I move
the setup to the target vhost domain I'm struggling to get this working with
the https live site. 

        location /storage/attachments/ {
		root   /srv/website/domain/;
		auth_request     /authin;
		auth_request_set $auth_status $upstream_status;
        }

	location = /authin {
		internal;
		set $query '';
		if ($request_uri ~*
"\/storage\/attachments\/([0-9]+)\/([0-9]+)\/([A-Za-z.]+).*") {
			set $query $2;
		}
		proxy_pass /auth/auth.php?content_id=$query;
		proxy_pass_request_body off;
		proxy_set_header Content-Length "";
		proxy_set_header X-Original-URI $request_uri;
	} 

is working fine on the http setup,

I've tried 
resolver 8.8.8.8;
proxy_pass https://indiastudycircle.org/auth/auth.php?content_id=$query;

But I'm not sure if $query is being set at all ... on the simple setup I can
see errors and that helped me set it all up, but on the vhost setup while I
can create php errors on the logs there is nothing for the auth processing?
Where do I head next?

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,287570,287570#msg-287570



More information about the nginx mailing list