Try to set<br><br>default_type    text/javascript;<br><br>instead of add_header.<br><br>Regards,<br>Wandenberg<br><br><div class="gmail_quote">On Tue, Oct 23, 2012 at 9:50 PM, Tom van der Woerdt <span dir="ltr"><<a href="mailto:info@tvdw.eu" target="_blank">info@tvdw.eu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I'm using nginx' locations to serve a javascript file on '/client' :<br>
<br>
    location = /client {<br>
        expires epoch;<br>
        alias /path/to/a/file.js;<br>
    }<br>
<br>
Works fine, with one major exception: it gets an octet-stream Content-Type header. I tried to solve this with :<br>
<br>
        add_header Content-Type text/javascript;<br>
<br>
Now I get two Content-Type headers.<br>
<br>
The raw response:<br>
<br>
< HTTP/1.1 200 OK<br>
< Server: nginx/1.3.6<br>
< Date: Tue, 23 Oct 2012 23:42:27 GMT<br>
< Content-Type: application/octet-stream<br>
< Content-Length: 23245<br>
< Last-Modified: Sat, 20 Oct 2012 00:09:12 GMT<br>
< Connection: keep-alive<br>
< ETag: "5081eba8-5acd"<br>
< Expires: Thu, 01 Jan 1970 00:00:01 GMT<br>
< Cache-Control: no-cache<br>
< Content-Type: text/javascript<br>
< Accept-Ranges: bytes<br>
<br>
nginx information :<br>
<br>
nginx version: nginx/1.3.6<br>
built by gcc 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)<br>
TLS SNI support enabled<br>
configure arguments: --user=nginx --group=nginx --with-http_ssl_module --with-http_gzip_static_module --with-http_secure_link_module --with-http_realip_module --with-http_stub_status_module --with-ipv6 --with-openssl=/root/<u></u>libraries/openssl-1.0.1c/ --prefix=/etc/nginx/ --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.<u></u>conf --error-log-path=/var/log/<u></u>nginx/error.log --http-log-path=/var/log/<u></u>nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.<u></u>lock --http-client-body-temp-path=/<u></u>var/cache/nginx/client_temp --http-proxy-temp-path=/var/<u></u>cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/<u></u>cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/<u></u>cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/<u></u>cache/nginx/scgi_temp<br>

<br>
Server information :<br>
<br>
Linux hostname.goes.here 2.6.32-279.5.2.el6.centos.<u></u>plus.i686 #1 SMP Thu Aug 23 22:13:33 UTC 2012 i686 i686 i386 GNU/Linux<br>
<br>
It's not a major issue for me (browsers will accept octet-stream just fine) but might be annoying for other people, should they ever run into this.<br>
<br>
Tom<br>
<br>
______________________________<u></u>_________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org" target="_blank">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" target="_blank">http://mailman.nginx.org/<u></u>mailman/listinfo/nginx-devel</a><br>
</blockquote></div><br>