Permalink
Browse files

add nginx url rewrite conf

  • Loading branch information...
1 parent 5665491 commit 0a8b303c987b52663855ebb17e4e757b2d2e9741 @fyears fyears committed Mar 20, 2013
Showing with 19 additions and 0 deletions.
  1. +19 −0 examples/urlrewrite/nginx.conf
@@ -0,0 +1,19 @@
+# If you are using Nginx, add the following to your server declaration,
+# and restart your Nginx.
+
+# ATTENTION:
+# Besides editing your Nginx configuation, REMEMBER to
+# set the option('base_uri') in your configure() function (for example):
+# option('base_uri', '/');
+# Then the function url_for() will work properly (for example).
+# url_for('one', 'two'); # returns /one/two instead of ?/one/two
+
+server {
+ location / {
+
+ try_files $uri $uri/ @rewrite;
+ }
+ location @rewrite {
+ rewrite ^/(.*)$ /index.php?u=$1&$args;
+ }
+}

0 comments on commit 0a8b303

Please sign in to comment.