Skip to content

Instantly share code, notes, and snippets.

@dragolabs
Created August 2, 2013 04:06
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dragolabs/6137419 to your computer and use it in GitHub Desktop.
Save dragolabs/6137419 to your computer and use it in GitHub Desktop.
nginx config for vbulletin 5 forum. And read the comments in config.php: // ****** Base URLs ****** // The following settings all deal with the url of your forum. // If set incorrectly your site/software will not function correctly. // These urls should NOT include a trailing slash <------- !!! // This is the url and web path of your root vBulle…
server {
listen 80;
server_name forum.example.com;
root /var/www/example_forum/;
index index.php;
access_log /var/log/nginx/forum.example.access.log main;
error_log /var/log/nginx/forum.example.error.log;
rewrite /css.php$ /core/css.php last;
rewrite /install$ /core/install/ last;
location ~* ^.+\.(js|json|ico|gif|jpg|jpeg|pdf|png|css|woff|ttf|otf|eot)$ {
root /var/www/example_forum/;
access_log off;
log_not_found off;
expires 7d;
}
location / {
try_files $uri $uri/ @vbulletin;
}
location = /admincp/ {
try_files $uri @vbulletin;
}
location @vbulletin {
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_param QUERY_STRING routestring=$uri&$args;
}
location ~ \.php$ {
try_files $uri @vbulletin;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
fastcgi_intercept_errors on;
}
}
@pyro2927
Copy link

pyro2927 commented Nov 4, 2013

Does this work better than the "official" nginx config? I'm trying to get vBulletin 5.0.5 running with nginx and php-fpm, but am having trouble with some of the rewrites.

@tobsn
Copy link

tobsn commented Aug 18, 2015

I love you.

@Dangerousfish
Copy link

Thank you!

Much better than the one that arrives with VB as that doesn't account for a few items this catches.

@Dragonisser
Copy link

Works like a charm, unlike the original vhost file...

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