<font size=2 face="sans-serif">Hi</font>
<br>
<br><font size=2 face="sans-serif">I am using nginx as reverse proxy and
i have several names pointing to reverse proxy and i am using proxy cache.
My backends are basic LAMP servers and IBM Lotus Domino servers.</font>
<br>
<br><font size=2 face="sans-serif">Just wondering whats wrong as i changed
domain to point my new nginx server and i am getting wrong content, i am
getting wrong virtual host index page.</font>
<br>
<br><font size=2 face="sans-serif">eg. i am trying to </font><a href=http://www.silverice.org/><font size=2 face="sans-serif">http://www.silverice.org/</font></a><font size=2 face="sans-serif">
and i am getting content from </font><a href=http://www.etappi.com/><font size=2 face="sans-serif">http://www.etappi.com/</font></a><font size=2 face="sans-serif">
they reside same LAMP-server. Looking my nginx configuration i cant find
anything wrong.</font>
<br><font size=2 face="sans-serif">both named points to new nginx reverse
proxy server. nginx version 0.7.65</font>
<br>
<br><font size=2 face="sans-serif">Here is example from my config:</font>
<br>
<br><font size=2 face="sans-serif">my main config, main parts:</font>
<br><font size=2 face="sans-serif">------------8<--------------------------------</font>
<br><tt><font size=2>http {</font></tt>
<br><tt><font size=2> proxy_cache_path /usr/share/nginx/cache
levels=1:2 keys_zone=one:10m max_size=1G;</font></tt>
<br><tt><font size=2> proxy_temp_path /usr/share/nginx/tmp;</font></tt>
<br>
<br><tt><font size=2> proxy_cache_valid 200 302 5m;</font></tt>
<br><tt><font size=2> proxy_cache_valid 301 1h;</font></tt>
<br><tt><font size=2> proxy_cache_valid any 1m;</font></tt>
<br>
<br><tt><font size=2> proxy_cache one;</font></tt>
<br>
<br><tt><font size=2> gzip_http_version 1.1;</font></tt>
<br><tt><font size=2> gzip_vary
on;</font></tt>
<br><tt><font size=2> gzip_min_length 1100;</font></tt>
<br><tt><font size=2> gzip_buffers 16 8k;</font></tt>
<br><tt><font size=2> gzip_disable "MSIE [1-6]\.(?!.*SV1)";</font></tt>
<br><tt><font size=2> gzip_proxied any;</font></tt>
<br><tt><font size=2> gzip_types text/css
text/plain application/atom+xml application/x-javascript application/xml
text/javascript application/xml+rss;</font></tt>
<br><tt><font size=2> gzip on;</font></tt>
<br>
<br><tt><font size=2> server_tokens off;</font></tt>
<br><tt><font size=2> client_header_timeout 3m;</font></tt>
<br><tt><font size=2> send_timeout
3m;</font></tt>
<br><tt><font size=2> client_header_buffer_size 1k;</font></tt>
<br><tt><font size=2> large_client_header_buffers 4 4k;</font></tt>
<br><tt><font size=2> output_buffers 1 32k;</font></tt>
<br><tt><font size=2> postpone_output 1460;</font></tt>
<br><tt><font size=2> sendfile
on;</font></tt>
<br><tt><font size=2> tcp_nopush on;</font></tt>
<br><tt><font size=2> tcp_nodelay on;</font></tt>
<br><tt><font size=2> keepalive_timeout 75 20;</font></tt>
<br><tt><font size=2> server_names_hash_bucket_size 128; #
this seems to be required for some vh</font></tt>
<br>
<br><tt><font size=2> log_format main '$remote_addr
- $remote_user [$time_local] $request '</font></tt>
<br><tt><font size=2>
'"$status" $body_bytes_sent "$http_referer"
'</font></tt>
<br><tt><font size=2>
'"$http_user_agent" "$http_x_forwarded_for"';</font></tt>
<br>
<br><tt><font size=2> proxy_redirect off;</font></tt>
<br><tt><font size=2> proxy_set_header Host
$host;</font></tt>
<br><tt><font size=2> proxy_set_header X-Real-IP
$remote_addr;</font></tt>
<br><tt><font size=2> proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for;</font></tt>
<br><tt><font size=2> proxy_connect_timeout 90;</font></tt>
<br><tt><font size=2> proxy_send_timeout 90;</font></tt>
<br><tt><font size=2> proxy_read_timeout 90;</font></tt>
<br>
<br><tt><font size=2> # default virtual host</font></tt>
<br><tt><font size=2> server {</font></tt>
<br><tt><font size=2> listen
80 default;</font></tt>
<br><tt><font size=2> server_name
_;</font></tt>
<br>
<br><tt><font size=2> access_log /var/log/nginx/default-access.log
main;</font></tt>
<br>
<br><tt><font size=2> server_name_in_redirect
off;</font></tt>
<br>
<br><tt><font size=2> location / {</font></tt>
<br><tt><font size=2> index index.html;</font></tt>
<br><tt><font size=2> root /var/www/default/htdocs;</font></tt>
<br><tt><font size=2> }</font></tt>
<br><tt><font size=2> }</font></tt>
<br>
<br><tt><font size=2> # here resides my virtual host configurations</font></tt>
<br><tt><font size=2> include /etc/nginx/virtual-hosts/*;</font></tt>
<br>
<br><tt><font size=2>}</font></tt>
<br>
<br><tt><font size=2>and my virtual hosts under: /etc/nginx/virtual-hosts
-directory:</font></tt>
<br>
<br><tt><font size=2>they all look like this:</font></tt>
<br><a href=www.silverice.org:/><tt><font size=2>www.silverice.org:</font></tt></a>
<br><tt><font size=2>--------------------------8<----------------</font></tt>
<br><tt><font size=2># redirect silverice.org -> </font></tt><a href=www.silverice.org><tt><font size=2>www.silverice.org</font></tt></a>
<br><tt><font size=2>server {</font></tt>
<br><tt><font size=2> server_name silverice.org;</font></tt>
<br><tt><font size=2> rewrite ^/(.*)$ </font></tt><a href=http://www.silverice.org/$1><tt><font size=2>http://www.silverice.org/$1</font></tt></a><tt><font size=2>
permanent;</font></tt>
<br><tt><font size=2>}</font></tt>
<br>
<br><tt><font size=2>server {</font></tt>
<br><tt><font size=2> server_name </font></tt><a href=www.silverice.org><tt><font size=2>www.silverice.org</font></tt></a><tt><font size=2>;</font></tt>
<br><tt><font size=2> access_log /somedirectory/www.silverice.org/www.silverice.org-access_log
combined;</font></tt>
<br><tt><font size=2> default_type text/html;</font></tt>
<br><tt><font size=2> root /usr/share/nginx/huolto;</font></tt>
<br>
<br><tt><font size=2> location / {</font></tt>
<br>
<br><tt><font size=2> proxy_pass </font></tt><a href=http://ip.add.re.ss/><tt><font size=2>http://ip.add.re.ss</font></tt></a><tt><font size=2>;</font></tt>
<br>
<br><tt><font size=2> # manual maintenance window</font></tt>
<br><tt><font size=2> include /etc/nginx/maintenance.conf;</font></tt>
<br><tt><font size=2> }</font></tt>
<br>
<br><tt><font size=2> # custom errorpages</font></tt>
<br><tt><font size=2> include /etc/nginx/errorpages.conf;</font></tt>
<br>
<br><tt><font size=2> # general block rules, security rules,
etc</font></tt>
<br><tt><font size=2> include /etc/nginx/suojaus.conf;</font></tt>
<br><tt><font size=2>}</font></tt>
<br><tt><font size=2>-----------------------------8<------------------</font></tt>
<br><tt><font size=2>And other virtual host like </font></tt><a href=www.etappi.com><tt><font size=2>www.etappi.com</font></tt></a><tt><font size=2>
looks like that, except name and access log changed. </font></tt>
<br>
<br><tt><font size=2>How come when trying to load </font></tt><a href=www.silverice.org><tt><font size=2>www.silverice.org</font></tt></a><tt><font size=2>
i am getting </font></tt><a href=www.etappi.com><tt><font size=2>www.etappi.com</font></tt></a><tt><font size=2>
content, mainly index page comes from wrong site.</font></tt>
<br>
<br><tt><font size=2>Looking backend logs i cant find error there, nothing
has changed there, name based virtual host there, Apache v2.</font></tt>
<br><font size=2 face="sans-serif"><br>
Terveisin/Regards,<br>
Pekka Panula, Sofor Oy - Jatkuvat palvelut<br>
</font>