]> sipb.mit.edu Git - ikiwiki.git/blob - doc/forum/nginx:_404_plugin_not_working/comment_4_5a8c2987f442106c68eb822c5bce3bf1._comment
ikiwiki (3.20130711) unstable; urgency=low
[ikiwiki.git] / doc / forum / nginx:_404_plugin_not_working / comment_4_5a8c2987f442106c68eb822c5bce3bf1._comment
1 [[!comment format=mdwn
2  username="http://tychoish.livejournal.com/"
3  ip="74.108.56.136"
4  subject="Alternative"
5  date="2011-06-04T12:57:14Z"
6  content="""
7 I just have the following in my nginx config, which isn't as friendly, I think, as a 404 plugin, but it does the job: 
8
9         location / {
10             index  index.html index.htm;
11             if (!-d $request_filename) {
12                rewrite ^/(.*)/$ /ikiwiki.cgi?page=$1&do=create last;
13                rewrite ^(.*)/$ /$1.html last;
14                rewrite ^(.*)/$ /$1.htm last;
15             }
16             if (!-e $request_filename) {
17                rewrite ^/(.*)$ /ikiwiki.cgi?page=$1&do=create last;
18                rewrite ^(.*)$ $1.html last;
19                rewrite ^(.*)$ $1.htm last;
20             }
21         }
22
23 """]]