Score:0

Apache reverse proxy to Node server bypass

bl flag

I have an Apache server that is working as a reverse proxy to a node server. I'm trying to bypass the proxy for a static file i.e. ads.txt

I have the following conf:

  <Files "ads.txt"> 
      Order Deny,Allow 
      Allow from all
  </Files>
  <Location "/ads.txt">
     SetHandler None
     Require all granted
  </Location>
  ProxyPass /ads.txt !  
  ProxyPass / http://localhost:3000/
  ProxyPassReverse / http://localhost:3000/

But this causes a redirect loop when trying to access https://www.example.com/ads.txt and has me stumped. Can anyone shed some light on this?

Thanks

cn flag
Bob
At first glance the `Files` and `Location` blocks are completely redundant, but otherwise the syntax appears OK. What do your log files say?
John Sourcer avatar
bl flag
Simply: xxx.xxx.xxx.xxx - - [06/Jan/2022:10:01:41 +0000] "GET /ads.txt HTTP/1.1" 301 244
cn flag
Bob
Is there a .htaccess file or anything else in the Apache http configuration files with redirect and/or mod_rewrite rules?
John Sourcer avatar
bl flag
Not that I can find. So it's going to be something stupid on my part. :(
John Sourcer avatar
bl flag
I corrected this be rebuilding the server.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.