Forum: NGINX Add slash to the end of every url (rewrite rule)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3222c3565462170543b04a87b5b00651?d=identicon&s=25 Steffen Lindner (Guest)
on 2009-03-14 21:38
(Received via mailing list)
Hi list,

i am a little bit lost in rewirt rules / regex.

I try to get an "/" to every urls end.

For better understanding check this:

http://3much.schnickschnack.info/art/projekte

If u press on a small thumbnail under the big picture it reloads and
shows this url:

http://3much.schnickschnack.info/art/projekte/#0

If i now have a slash on all urls (on the end) it would work without
a reload of the site.

I use ngnix 0.7.30. The CMS is plone.

Hope someone can help.

Thx in advance!

Gomez
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-03-14 21:52
(Received via mailing list)
On Sat, Mar 14, 2009 at 07:06:28PM +0100, Steffen Lindner wrote:

> If u press on a small thumbnail under the big picture it reloads and
> shows this url:
>
> http://3much.schnickschnack.info/art/projekte/#0
>
> If i now have a slash on all urls (on the end) it would work without
> a reload of the site.
>
> I use ngnix 0.7.30. The CMS is plone.
>
> Hope someone can help.

location ~ [^/]$ {
    rewrite  ^  http://site.com$uri/;
}
546a8a5934ecd4cd2b3ae904a04a5ed9?d=identicon&s=25 mangoo (Guest)
on 2009-03-15 05:19
(Received via mailing list)
I've set a cookie with slash, so browser automatic add quotation marks
to
the string.
So how to remove these quotation marks by following rule:
          set $path "";
          if ($http_cookie ~ "pp=([^;]+)(?:;|$)") {
             set  $path  $1;
          }
          sub_filter pp $path;

Firstly, set a cookie with value test/opt, and browser will set it to
"test/opt",
Then $http_cookie will get "test/opt". In fact, we don't need quotation
marks.

Definitely, these quotation marks should not be passed to $http_cookie.

How to avoid it?

Thanks in advance!

Regards
Mangoo
This topic is locked and can not be replied to.