Hello All!<br>I am relatively new nginx user (~ 3 months), a convert from the lighttpd camp. <br>I have been very happy with the elegance and power behind nginx and I am in the process of converting all of the servers in our cluster to nginx/apache/mongrel (from lighttpd and scgi)
<br><br>Anyway, here is my problem. <br>The environment is FreeBSD 6.2 running on AMD 64<br>I have nginx 0.5.11 setup to forward PHP requests to apache 1.3 (bound to <a href="http://127.0.0.1:8080">127.0.0.1:8080</a>)&nbsp; while serving static files locally using sendfile(2) 
<br><br>Nginx seems to be modifying the expiration and cache control headers when I go to /, yet eerily enough it leaves them alone if you go to /index.php.<br>Here are the associated http response headers:<br><br>For /<br>
&nbsp; Server&nbsp;&nbsp;&nbsp; nginx/0.5.11<br>&nbsp; Date&nbsp;&nbsp;&nbsp; Mon, 16 Apr 2007 13:04:12 GMT<br>&nbsp; Content-Type&nbsp;&nbsp;&nbsp; text/html; charset=ISO-8859-1<br>&nbsp; Transfer-Encoding&nbsp;&nbsp;&nbsp; chunked
<br>&nbsp; Connection&nbsp;&nbsp;&nbsp; keep-alive<br>&nbsp; X-Powered-By&nbsp;&nbsp;&nbsp; PHP/5.2.1<br>&nbsp; Expires&nbsp;&nbsp;&nbsp; Wed, 16 May 2007 13:04:12 GMT<br>&nbsp; Cache-Control&nbsp;&nbsp;&nbsp; max-age=2592000<br>&nbsp; Pragma&nbsp;&nbsp;&nbsp; no-cache<br>&nbsp; Content-Encoding&nbsp;&nbsp;&nbsp; gzip<br><br>For /index.php
<br>&nbsp; Server&nbsp;&nbsp;&nbsp; nginx/0.5.11<br>&nbsp; Date&nbsp;&nbsp;&nbsp; Mon, 16 Apr 2007 13:05:14 GMT<br>&nbsp; Content-Type&nbsp;&nbsp;&nbsp; text/html; charset=ISO-8859-1<br>&nbsp; Transfer-Encoding&nbsp;&nbsp;&nbsp; chunked<br>&nbsp; Connection&nbsp;&nbsp;&nbsp; keep-alive<br>&nbsp; X-Powered-By&nbsp;&nbsp;&nbsp; PHP/5.2.1<br>

&nbsp; Expires&nbsp;&nbsp;&nbsp; 0<br>&nbsp; Cache-Control&nbsp;&nbsp;&nbsp; private, post-check=0, pre-check=0, max-age=0<br>&nbsp; Pragma&nbsp;&nbsp;&nbsp; no-cache<br>&nbsp; Content-Encoding&nbsp;&nbsp;&nbsp; gzip<br><br>I have attached my nginx.conf below. Also if you have any optimization recommendations, please let me know.
<br>Thanks for the help!<br><br>-Erik Karulf<br><br>nginx.conf&gt;&gt;EOF<br>user &nbsp;www;<br>worker_processes &nbsp;1;<br>#pid &nbsp; &nbsp; &nbsp; &nbsp;logs/nginx.pid;<br><br>events {<br> &nbsp; worker_connections &nbsp;8192;<br> &nbsp; use kqueue;<br>}<br><br>
<br>http {<br> &nbsp; include &nbsp; &nbsp; &nbsp; mime.types;<br> &nbsp; default_type &nbsp;application/octet-stream;<br> &nbsp; access_log &nbsp; &nbsp; &nbsp; &nbsp;off;<br> &nbsp; error_log &nbsp; &nbsp; &nbsp; &nbsp; off;<br> &nbsp; sendfile &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;on;<br> &nbsp; tcp_nopush &nbsp; &nbsp; &nbsp; &nbsp;on;<br> &nbsp; tcp_nodelay &nbsp; &nbsp; &nbsp; on;
<br><br> &nbsp; keepalive_timeout 65;<br> &nbsp; server_names_hash_bucket_size 128; # this seems to be required for vhosts<br><br> &nbsp; gzip &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;on;<br> &nbsp; gzip_min_length &nbsp; 1100;<br> &nbsp; gzip_buffers &nbsp; &nbsp; &nbsp;4 8k;<br> &nbsp; gzip_http_version 
1.0;<br> &nbsp; gzip_comp_level &nbsp; 2;<br> &nbsp; gzip_proxied &nbsp; &nbsp; &nbsp;any;<br>
&nbsp; gzip_types &nbsp; &nbsp; &nbsp; &nbsp;text/plain text/html text/css
application/x-javascript text/xml application/xml application/xml+rss
text/javascript;<br><br> &nbsp; proxy_redirect &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; off;<br> &nbsp; proxy_set_header &nbsp; &nbsp; &nbsp; &nbsp; Host $host;<br> &nbsp; proxy_set_header &nbsp; &nbsp; &nbsp; &nbsp; X-Real-IP $remote_addr;<br> &nbsp; proxy_set_header &nbsp; &nbsp; &nbsp; &nbsp; X-Forwarded-For $proxy_add_x_forwarded_for;
<br> &nbsp; client_max_body_size &nbsp; &nbsp; 10m;<br> &nbsp; client_body_buffer_size &nbsp;128k;<br> &nbsp; proxy_connect_timeout &nbsp; &nbsp;90;<br> &nbsp; proxy_send_timeout &nbsp; &nbsp; &nbsp; 90;<br> &nbsp; proxy_read_timeout &nbsp; &nbsp; &nbsp; 90;<br> &nbsp; proxy_buffer_size &nbsp; &nbsp; &nbsp; &nbsp;4k;<br> &nbsp; proxy_buffers &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4 32k;
<br> &nbsp; proxy_busy_buffers_size &nbsp;64k;<br> &nbsp; proxy_temp_file_write_size &nbsp;64k;<br><br><br>&nbsp; # <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://forums.penny-arcade.com/" target="_blank">http://forums.example.com
</a><br> &nbsp; server {<br> &nbsp; &nbsp; &nbsp;listen &nbsp; &nbsp; &nbsp; &nbsp; 80;<br> &nbsp; &nbsp; &nbsp;server_name &nbsp; &nbsp;<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://forums.penny-arcade.com/" target="_blank">forums.example.com</a>;<br><br> &nbsp; &nbsp; &nbsp;location / {
<br> &nbsp; &nbsp; &nbsp; &nbsp; root &nbsp; /www/forums.<span style="text-decoration: underline;">example</span><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://arcade.com/" target="_blank">.com/</a>;<br> &nbsp; &nbsp; &nbsp; &nbsp; index&nbsp; index.html
 index.htm index.php;<br><br> &nbsp; &nbsp; &nbsp; &nbsp; if ($request_filename !~* &quot;^.+.(php|php3)$&quot;) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;root &nbsp; /www/forums.<span style="text-decoration: underline;">example</span><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://arcade.com/" target="_blank">
.com/</a>;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;expires &nbsp; &nbsp;30d;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<br> &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; expires &nbsp; &nbsp;off;<br> &nbsp; &nbsp; &nbsp; &nbsp; proxy_pass <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://127.0.0.1:8080/" target="_blank">
http://127.0.0.1:8080/</a>;<br> &nbsp; &nbsp; &nbsp;}<br><br> &nbsp; &nbsp; &nbsp;location = /clear.gif {<br> &nbsp; &nbsp; &nbsp; &nbsp; empty_gif;<br> &nbsp; &nbsp; &nbsp; &nbsp; expires &nbsp; &nbsp; 30d;<br> &nbsp; &nbsp; &nbsp;}<br> &nbsp; }<br>}<br>EOF<br>