Skip to content

Instantly share code, notes, and snippets.

@Gipetto
Last active October 1, 2015 02:38
Show Gist options
  • Save Gipetto/1904153 to your computer and use it in GitHub Desktop.
Save Gipetto/1904153 to your computer and use it in GitHub Desktop.
Alternate OpenVBX nginx server config. Slightly different than the sample included with OpenVBX right now and working on my nginx 0.8.54 + PHP 5.3.5 install
server {
listen 80;
server_name openvbx.tld;
access_log /var/www/logs/access.log;
error_log /var/www/logs/error.log;
location /(favicon.ico|robots.txt) {
access_log off;
log_not_found off;
error_page 404 /404;
expires 30d;
add_header Cache-Control public;
}
location / {
root /path/to/OpenVBX;
index index.php
try_files $uri $uri/ /index.php?vbxsite=$uri&$query_string;
}
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 /var/www/OpenVBX/$fastcgi_script_name;
}
}
@ideeliah
Copy link

The above doesn't work...

All that needs to be done is pasting this location directive above php directive:

location / {
    if (!-e $request_filename){
    rewrite ^/(.*) /index.php?vbxsite=$1;
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment