It's been a good learning experience, and I can't say enough about this webserver software, it's awesome
Anywho, to help others moving into nginx, here's my site config file for my forum.
Please note, this is for a version of phpbb-seo that I installed roughly a year ago. dunno if anything has changed in the rewrite rules in the current release(s), but maybe this will at least give a starting point for others.
- Code: Select all
server {
listen 67.23.21.55:80;
server_name forum.phpsitesolutions.com;
root /var/www/forum.phpsitesolutions.com/public/phpbb2/;
index index.php index.html;
fastcgi_index index.php;
access_log /var/www/forum.phpsitesolutions.com/log/access.log;
error_log /var/www/forum.phpsitesolutions.com/log/error.log warn;
# if the request starts with our frontcontroller, pass it on to fastcgi
location ~ \.php
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location / {
# PHPBB SEO REWRITE RULES - ADVANCED
# AUTHOR : dcz www.phpbb-seo.com
# STARTED : 01/2006
# FORUM
rewrite ^/[a-z0-9_-]*-f([0-9]+)/?(page([0-9]+)\.html)?$ /viewforum.php?f=$1&start=$3 last;
# TOPIC WITH VIRTUAL FOLDER
rewrite ^/[a-z0-9_-]*-f([0-9]+)/[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html$ /viewtopic.php?f=$1&t=$2&start=$4 last;
# GLOBAL ANNOUNCES WITH VIRTUAL FOLDER
rewrite ^/announces/[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html$ /viewtopic.php?t=$1&start=$3 last;
# TOPIC WITHOUT FORUM ID & DELIM
rewrite ^/([a-z0-9_/-]*)/?[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html$ /viewtopic.php?forum_uri=$1&t=$2&start=$4 last;
# PROFILES THROUGH USERNAME
rewrite ^/member/([^/]+)/?$ /memberlist.php?mode=viewprofile&un=$1 last;
# USER MESSAGES THROUGH USERNAME
rewrite ^/member/([^/]+)/(topics|posts)/?(page([0-9]+)\.html)?$ /search.php?author=$1&sr=$2&start=$4 last;
# GROUPS ADVANCED
rewrite ^/[a-z0-9_-]*-g([0-9]+)(-([0-9]+))?\.html$ /memberlist.php?mode=group&g=$1&start=$3 last;
# POST
rewrite ^/post([0-9]+)\.html$ /viewtopic.php?p=$1 last;
# ACTIVE TOPICS
rewrite ^/active-topics(-([0-9]+))?\.html$ /search.php?search_id=active_topics&start=$2&sr=topics last;
# UNANSWERED TOPICS
rewrite ^/unanswered(-([0-9]+))?\.html$ /search.php?search_id=unanswered&start=$2&sr=topics last;
# NEW POSTS
rewrite ^/newposts(-([0-9]+))?\.html$ /search.php?search_id=newposts&start=$2&sr=topics last;
# THE TEAM
rewrite ^/the-team\.html$ /memberlist.php?mode=leaders last;
# HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES
# FORUM WITHOUT ID & DELIM
# THESE THREE LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY
if (!-e $request_filename) {
rewrite ^/([a-z0-9_/-]+)/?(page([0-9]+)\.html)?$ /viewforum.php?forum_uri=$1&start=$3 last;
break;
}
# END PHPBB PAGES
}
}

English |
French


