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:
gallery.wfto.cc — Doesn’t work (downloads an unnamed file containing the PHP code of index.php because it isn’t getting parsed)
gallery.wfto.cc/ — Doesn’t work (same thing)
gallery.wfto.cc/index.php — Doesn’t work (same thing)
gallery.wfto.cc/index.php/ — Works.
gallery.wfto.cc:9001 (all variants) — 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.
##NGINX CONFIG##
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;
}
}
## APACHE CONFIG ##
<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>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
I don’t know at what point things started working, but if you’re changing server configurations make sure you clear your browser’s cache completely.