Welcome! Log In Create A New Profile

Advanced

Strange proxy_pass problem

Rainer Duffner
October 18, 2013 11:36AM
Hi,


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

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
</Directory>

(php is chrooted with php-fpm)

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

<VirtualHost *:8080>
ServerAdmin rdudemotest2@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
</Directory>
FastCgiExternalServer /home/www/fastcgi/rdudemotest2.server -socket
rdudemotest2.sock
Alias /php.fcgi /home//www/fastcgi/rdudemotest2.server </VirtualHost>

For nginx, I have in nginx.conf:

upstream apache8080 {
server 127.0.0.1:8080;
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 ;
proxy_pass http://127.0.0.1:8080;
}
location /phpmyadmin/ {
include proxy.conf ;
proxy_pass http://127.0.0.1:8080;
}
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
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 ~*
^.+.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|woff|mp3)$
{ 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
previously.


Can anyone shed some light on this?



_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Strange proxy_pass problem

Rainer Duffner October 18, 2013 11:36AM

Re: Strange proxy_pass problem

Francis Daly October 18, 2013 12:52PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 230
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready