<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:inherit;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>I have a RESTful API on my website that uses the Tonic.php frame work to create the API.  I am running Apache2 and Varnish.  The web site and the API works great, but the API returns a code 302 along with the data.  It is causing the client apps to have trouble getting the data from the API.  Is there any way to get a 200 response sent back?  I though the below would stop the 302 response, but it is not.  If you need more information or want to try the API let me know and I will send you the information.   <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'># Do not cache these paths.<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>  if (req.url ~ "^/status\.php$" ||<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>      req.url ~ "^/update\.php$" ||<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>      req.url ~ "^/admin$" ||<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>      req.url ~ "^/admin/.*$" ||<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>      req.url ~ "^/flag/.*$" ||<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>      req.url ~ "^/munin/.*$" ||<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>      req.url ~ "^.*/ajax/.*$" ||<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>      req.url ~ "^.*/api/.*$" ||<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>      req.url ~ "^.*/apidev/.*$" ||<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>      req.url ~ "^.*/phpmyadmin/.*$" ||<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>      req.url ~ "^.*/ahah/.*$") {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>       return (pass);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>  }<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Here is the headers I am getting back.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='line-height:14.65pt;background:white'><b><span style='font-size:13.5pt;font-family:Consolas;color:#5CA816;border:none windowtext 1.0pt;padding:0in;background:white'>HTTP/1.1 302 Found</span></b><span style='font-size:10.0pt;font-family:"Times New Roman","serif";color:#3D3D3D'><o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#0B599F'>X-Varnish-Cache:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in;line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#7C1392'>MISS<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#0B599F'>X-Varnish:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in;line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#7C1392'>1548785385<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#0B599F'>Age:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in;line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#7C1392'>0<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#0B599F'>Date:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in;line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#7C1392'>Wed, 29 Aug 2012 23:37:34 GMT<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#0B599F'>Content-Length:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in;line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#7C1392'>27173<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#0B599F'>Allow:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in;line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#7C1392'>PUT, GET<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#0B599F'>X-Resource:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in;line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#7C1392'>TaskHandler<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#0B599F'>Via:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in;line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#7C1392'>1.1 varnish<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#0B599F'>Content-Type:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in;line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#7C1392'>application/json<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#0B599F'>Connection:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in;line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#7C1392'>close<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#0B599F'>X-Powered-By:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in;line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#7C1392'>PHP/5.3.2-1ubuntu4.17<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#0B599F'>Server:<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in;line-height:13.5pt;background:white'><span style='font-size:10.0pt;font-family:"inherit","serif";color:#7C1392'>Apache/2.2.14 (Ubuntu)<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>