rewrite rules

Boethius boethius at elitistjerks.com
Wed Feb 6 01:56:09 MSK 2008


I am attempting to use vBSEO with nginx as well. Your rules work great 
except image attachments currently aren't working. I believe vBSEO 
rewrites attachment URLs in Apache as well, but there aren't any 
applicable nginx rewrites active in the conf you posted.

Do you have any idea what might get them working (are they working for you)?

Jan Ślusarczyk wrote:
>>
> Thanks for all the tips. For a combination of Typo3 installation on root 
> (realurl rewriting to /index.php) and vbseo enhanced vbulletin in 
> /forum/ directory of a main site I've come up with the following:
> 
> server {
>     listen    192.168.1.1:80;
>     server_name    www.servername.tld;
>     access_log    /var/log/nginx/www.servername.tld.access.log    combined;
> 
>     root    /var/www/hosts/www.servername.tld;
>     index  index.php index.html index.htm;
> 
>     location ~ /\.ht {
>         deny all;
>     }
>     location /forum/ {
>         rewrite ^/forum/((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ 
> /forum/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 last;
>         if ($request_filename ~ "\.php$" ) {
>             rewrite ^(.*)$ /forum/vbseo.php?vbseourl=$1 last;
>         }
>         if (!-e $request_filename) {
>             rewrite ^/forum/(.*)$ /forum/vbseo.php?vbseourl=$1 last;
>         }
>     }
>     location / {
>         if (!-e $request_filename) {
>              rewrite ^(.*)$ /index.php last;
>         }
>     }   
>     location ~ \.php$ {
>         fastcgi_pass   127.0.0.1:9000;
>         fastcgi_index  index.php;
>         fastcgi_param  SCRIPT_FILENAME  
> /var/www/hosts/www.servername.tld$fastcgi_script_name;
>         include        /etc/nginx/fastcgi.conf;
>     }
> }
> 
> Does it make sense? Can it be better? Anything I should be aware of?
> Thank you
> Jan
> 

-- 

Andrew Hunn (Boethius)
boethius at elitistjerks.com





More information about the nginx mailing list