Hello!<br><br>I am having difficulty getting the Addition Module to function correctly. I simply want to add a chunk of html to the top of every html file served. My configuration is as follows:<br><br>(cutting out unneeded portions)<br>
<br> server {<br> ...<br> set $vhost '---';<br> if ($http_host ~ ^(.)(.)(.)(.+)\.domain\.com) {<br> set $vhost $1$2$3$4;<br> set $vdir $1/$2/$3/$vhost;<br> }<br>
<br> if ($vhost = '---') {<br> return 404;<br> }<br><br> location / {<br> add_before_body /.internal/banner.html;<br> root /www/users/$vdir;<br>
index index.html index.htm;<br> }<br><br> location /.internal/ {<br> internal;<br> root /www/html;<br> }<br> }<br><br><br>So I use the host as the username and do a 3 character hash (testing for invalid username format). The homedirs are rooted at /www/users. Hence <a href="http://user.domain.com">user.domain.com</a> is rooted at /www/users/u/s/e/user.<br>
<br>The file for the banner is located in /www/html/banner.html so I use the /.internal/ location to set the root. Then end result is this:<br><br><html><br><head><title>302 Found</title></head><br>
<body bgcolor="white"><br><center><h1>302 Found</h1></center><br><hr><center>nginx/0.6.29</center><br></body><br></html><br><html><br><body><br>
Body of the html page<br></body><br></html><br><br><br>Instead of the contents of banner.html, I am getting a 302 page.<br><br>What am I doing wrong? :)<br><br>TIA!<br><br>Tony<br>