osdir.com

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [users@httpd] Rewrite with proxy adds document root


On Mon, Sep 24, 2018 at 11:14 AM David Tkacik
<dtkacik@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> I have this config included via Include conf.d/myconfig/*.conf within my virtualhost.
>
> <Location "/requested-uri">
> ProxyAddHeaders off
> RewriteEngine on
> RewriteCond %{QUERY_STRING} ^123 [NC]
> RequestHeader set "X-API-KEY" "proxied"
> RewriteRule (.*) "https://${HOST}$1"; [QSD,P,L]
> </Location>
>
> But the above rule is also proxying the /var/www/html which is the document root. I have no idea why as this is not added via .htaccess
>
> So if you curl for example /requested-uri/123/index.html the proxied path would look /var/www/html/requested-uri/123/index.html
>
> Any ideas why ?
>
> Thanks a lot !

It's best to avoid Rewrite inside <Location>.  You could simply match
the URL's you want to match in the first arg of the rewriterule.



-- 
Eric Covener
covener@xxxxxxxxx

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx