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>) 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>
Server nginx/0.5.11<br> Date Mon, 16 Apr 2007 13:04:12 GMT<br> Content-Type text/html; charset=ISO-8859-1<br> Transfer-Encoding chunked
<br> Connection keep-alive<br> X-Powered-By PHP/5.2.1<br> Expires Wed, 16 May 2007 13:04:12 GMT<br> Cache-Control max-age=2592000<br> Pragma no-cache<br> Content-Encoding gzip<br><br>For /index.php
<br> Server nginx/0.5.11<br> Date Mon, 16 Apr 2007 13:05:14 GMT<br> Content-Type text/html; charset=ISO-8859-1<br> Transfer-Encoding chunked<br> Connection keep-alive<br> X-Powered-By PHP/5.2.1<br>
Expires 0<br> Cache-Control private, post-check=0, pre-check=0, max-age=0<br> Pragma no-cache<br> Content-Encoding 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>>EOF<br>user www;<br>worker_processes 1;<br>#pid logs/nginx.pid;<br><br>events {<br> worker_connections 8192;<br> use kqueue;<br>}<br><br>
<br>http {<br> include mime.types;<br> default_type application/octet-stream;<br> access_log off;<br> error_log off;<br> sendfile on;<br> tcp_nopush on;<br> tcp_nodelay on;
<br><br> keepalive_timeout 65;<br> server_names_hash_bucket_size 128; # this seems to be required for vhosts<br><br> gzip on;<br> gzip_min_length 1100;<br> gzip_buffers 4 8k;<br> gzip_http_version
1.0;<br> gzip_comp_level 2;<br> gzip_proxied any;<br>
gzip_types text/plain text/html text/css
application/x-javascript text/xml application/xml application/xml+rss
text/javascript;<br><br> proxy_redirect off;<br> proxy_set_header Host $host;<br> proxy_set_header X-Real-IP $remote_addr;<br> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
<br> client_max_body_size 10m;<br> client_body_buffer_size 128k;<br> proxy_connect_timeout 90;<br> proxy_send_timeout 90;<br> proxy_read_timeout 90;<br> proxy_buffer_size 4k;<br> proxy_buffers 4 32k;
<br> proxy_busy_buffers_size 64k;<br> proxy_temp_file_write_size 64k;<br><br><br> # <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://forums.penny-arcade.com/" target="_blank">http://forums.example.com
</a><br> server {<br> listen 80;<br> server_name <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://forums.penny-arcade.com/" target="_blank">forums.example.com</a>;<br><br> location / {
<br> root /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> index index.html
index.htm index.php;<br><br> if ($request_filename !~* "^.+.(php|php3)$") {<br> root /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> expires 30d;<br> break;<br> }<br> expires off;<br> 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> }<br><br> location = /clear.gif {<br> empty_gif;<br> expires 30d;<br> }<br> }<br>}<br>EOF<br>