Hi team,
I'm trying to set up OpenVBX (https://github.com/twilio/OpenVBX) and I'm having difficulty setting up nginx to handle requests to the index file.
I'm using the following set up:
server {
listen 80;
server_name my.subdomain.com;
access_log /home/myusername/public_html/my.subdomain.com/log/access.log;
error_log /home/myusername/public_html/my.subdomain.com/log/error.log;
location / {
root /home/myusername/public_html/my.subdomain.com/public;
index index.php;
if (-f $request_filename) {
break;
}
if (-d $request_filename) {
break;
}
rewrite ^(.*)$ /index.php?vbxsite=$1 last;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
proxy_pass_header Set-Cookie;
fastcgi_pass_header Set-Cookie;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/myusername/public_html/my.subdomain.com/public/$fastcgi_script_name;
}
}
While this works some of the time and pages are served and I can navigate quite hapily, I frequently receive 404 errors which can then last for some time before miraculously stopping.
Furthermore, if I add in the line to prevent zero hour:
try_files $uri =404;
...I get continual 404 errors and the set up fails to work entirely.
my nginx version is:
nginx/0.7.65
My php (fpm) version is:
PHP 5.3.10-1~lucid+2uwsgi2
If anyone can shed any light on why i'm getting an intermittent 404 and a continual 404 when adding in try_files, that would be great.
Thanks!