Welcome! Log In Create A New Profile

Advanced

Not-so-complicated nginx Reverse Proxy with Apache setup

Posted by meinemitternacht 
Not-so-complicated nginx Reverse Proxy with Apache setup
April 15, 2012 03:35PM
Hello! It's been a while since I was on the mailing list (I know I'm posting from the forum!), but I'm using nginx once again for all of my sites. Now, I have a peculiar problem.

I have a bunch of sites that work great with nginx + php-fastcgi and I have no complaints there! The only thing that doesn't work is a PHP gallery application called Gallery3. Sadly, I have to use Apache with this application. The problem I have is as follows:

http://gallery.wfto.cc -- Doesn't work (downloads an unnamed file containing the PHP code of index.php because it isn't getting parsed)
http://gallery.wfto.cc/ -- Doesn't work (downloads an unnamed file containing the PHP code of index.php because it isn't getting parsed)
http://gallery.wfto.cc/index.php -- Doesn't work (downloads an unnamed file containing the PHP code of index.php because it isn't getting parsed)
http://gallery.wfto.cc/index.php/ -- Works.

I have no idea what is going on. I included most of my configurations below. The /etc/nginx/conf.d/proxy.conf is a ... general proxy configuration, nothing special.

I set up nginx as a reverse proxy for apache as follows:

server {
listen 80; ## listen for ipv4
listen [::]:80 default ipv6only=on; ## listen for ipv6

root /var/www/vhosts/wfto.cc/subdomains/gallery;

server_name gallery.wfto.cc;
access_log /var/log/nginx/gallery.wfto.cc.access.log;

location / {
proxy_pass http://127.0.0.1:9001;
include /etc/nginx/conf.d/proxy.conf;
}
}

I'm using Apache2 with mod_fastcgi. Relevant Apache configuration:

<VirtualHost *:9001>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/vhosts/wfto.cc/subdomains/gallery
<IfModule mod_fastcgi.c>
AddHandler php5-fcgi .php
Action php5-fcgi /php5-fcgi
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
</IfModule>
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/vhosts/wfto.cc/subdomains/gallery/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
Re: Not-so-complicated nginx Reverse Proxy with Apache setup
April 15, 2012 03:50PM
Also of interest:

If I go to http://gallery.wfto.cc:9001, everything works great. It's just when it's being proxied it has a hard time processing the index page, even when explicitly entered.

Yes, I'm going to bind Apache to 127.0.0.1 only after I figure this out.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 100
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