Strange proxy_pass problem

Rainer Duffner rainer at
Fri Oct 18 15:34:22 UTC 2013


I recently upgraded a server from nginx 1.2.8 to 1.4.3 (on FreeBSD

nginx is a reverse-proxy to apache, intended to serve static files
directly and pass all php requests zu apache - with one exception: the
default vhost on both nginx and apache.

It looks like this (on apache):

<VirtualHost _default_:8080>

Alias /phpmyadmin   "/usr/local/www/phpMyAdmin/"

FastCgiExternalServer /home/www/fastcgi/www.server -socket www.sock
-flush -idle-timeout 120 Alias /php.fcgi /home/www/fastcgi/www.server

<Directory "/usr/local/www/phpMyAdmin">
    AllowOverride None
    Options FollowSymLinks
    Order allow,deny
    Allow from all

(php is chrooted with php-fpm)

and then there's a "normal" vhost like this:

<VirtualHost *:8080>
    ServerAdmin rdudemotest2 at bla
    ServerName rdudemotest2.bla
    DocumentRoot /home/rdudemotest2/FTPROOT/htdocs/
    CustomLog /home/rdudemotest2/logs/nginx_access_log combined
    ErrorLog /home/rduedmotest2/logs/error_log
    <Directory /home/rdudemotest2/FTPROOT/htdocs/>
        AllowOverride All
     FastCgiExternalServer /home/www/fastcgi/rdudemotest2.server -socket
Alias /php.fcgi  /home//www/fastcgi/rdudemotest2.server </VirtualHost>

For nginx, I have in nginx.conf:

    upstream apache8080 {
      keepalive 16;

and then a default vhost like this:

server {
        listen       80 default_server;
    access_log /home/nginx/logs/default-access_log;
    error_log /home/nginx/logs/default-error_log ;
    location  /  {
                        include proxy.conf ;
    location /phpmyadmin/    {
        include proxy.conf ;
    location /nginx_status {
        stub_status on;
        access_log   off;
        deny all;

and the vhost from above:

server {
    listen our.ip;
    server_name rdudemotest2.bla ;
    access_log /home/rdudemotest2/logs/nginx_access_log;
    error_log /home/rdudemotest2/logs/nginx_error_log;
    root /home/rdudemotest2/FTPROOT/htdocs;
    location ~*
{ expires 24h; }
    location / {
	include proxy.conf;
        proxy_pass http://apache8080;

Now, the problem is that while I can in principle access phpmyadmin,
(via http://our.ip/phpmyadmin/ - I can login, databases are displayed
etc.) the images aren't found anymore, because the requests for the
images end up at the non-default vhost rdudemotest2.

I haven't checked for a while, but I'm pretty sure this worked

Can anyone shed some light on this?

More information about the nginx mailing list