How could I serve all static files that start with "somestring-" and have no file extension as text/html?
Nginx serves them by default as a bin file sending a header Content-Type: application/octet-stream. Browser will offer the file for download instead of rendering the HTML. Please help my server is getting hammered. My current config goes like this:
server {
server_name site1;
root /var/html/site1/static;
index index.html index.htm;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
client_max_body_size 10M;
location / {
if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
if (!-f $request_filename) {
proxy_pass http://apache;
break;
}
}
}
Edited 2 time(s). Last edit at 05/27/2011 06:32AM by vbod.