the <div><br></div><div>putting $upstream_http_content_type or $sent_http_content_type or $content_type inside "if" does not work.</div><div>i wish someone could test and provide a working example.</div><div><br>
</div><div>none of the samples shown in the stackoverflow post work.</div><div><br></div><div>i tested enough and found that only $sent_http_content_type  contains the http response Content-type</div><div>and that can be tested like this</div>
<div><br></div><div>add_header TEST $sent_http_content_type</div><div><br></div><div>however putting that inside an if and trying to add further headers inside that if will not work</div><div>i opened a ticket in trac and they said that it does not work like that</div>
<div><br></div><div>however no one confirms if it is strictly possible or impossible.<br><br><div class="gmail_quote">On Fri, Jun 14, 2013 at 10:00 AM, Miguel Clara <span dir="ltr"><<a href="mailto:miguelmclara@gmail.com" target="_blank">miguelmclara@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>From what you describe I do think the
      suggested nginx config is enough...<br>
      <br>
      However maybe you're looking for something like this:<br>
      <br>
<a href="http://stackoverflow.com/questions/14631044/expires-header-based-on-dynamic-content-type-in-nginx" target="_blank">http://stackoverflow.com/questions/14631044/expires-header-based-on-dynamic-content-type-in-nginx</a><br>

      <br>
      Not really sure if it suits you're needs, but It seems this is
      what you're looking for.<br>
      <br>
      You can also find more info on mime type here:
      <a href="http://wiki.nginx.org/HttpCoreModule#types" target="_blank">http://wiki.nginx.org/HttpCoreModule#types</a><br>
      <br>
      Hope this helps,<br>
      <br>
      Mike<div><div class="h5"><br>
      <br>
      <br>
      On 06/14/13 03:12, Silver Moon wrote:<br>
    </div></div></div><div><div class="h5">
    <blockquote type="cite">yes, i could send out headers from php itself
      <div>but mime based header generation in the webserver itself
        would make things easier.</div>
      <div><br>
      </div>
      <div>so finally it is impossible to achieve that ?<br>
        <br>
        <div class="gmail_quote">
          On Fri, Jun 14, 2013 at 8:35 AM, Host DL <span dir="ltr"><<a href="mailto:hostdl@gmail.com" target="_blank">hostdl@gmail.com</a>></span> wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div class="gmail_default" style="font-family:tahoma,sans-serif">If you handle your
                js, css and images by php scripts you can use header
                function to send out Expires and Cache-Control
                directives</div>
              <div class="gmail_default" style="font-family:tahoma,sans-serif">
                <br>
              </div>
              <div class="gmail_default" style="font-family:tahoma,sans-serif">example:</div>
              <div class="gmail_default" style="font-family:tahoma,sans-serif"><br>
              </div>
              <div class="gmail_default">
                <div class="gmail_default"><font face="tahoma,
                    sans-serif"><?php</font></div>
                <div class="gmail_default"><font face="tahoma,
                    sans-serif">header("Cache-Control: no-cache,
                    must-revalidate"); // HTTP/1.1</font></div>
                <div class="gmail_default"><font face="tahoma,
                    sans-serif">header("Expires: Sat, 26 Jul 1997
                    05:00:00 GMT"); // Date in the past</font></div>
                <div class="gmail_default"><font face="tahoma,
                    sans-serif">?></font></div>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            nginx mailing list<br>
            <a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
            <a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        Silver<br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
nginx mailing list
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a></pre>
    </blockquote>
    <br>
  </div></div></div>

<br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Silver<br>
</div>