ALT Linux sysadmins discussion
 help / color / mirror / Atom feed
* [Sysadmins] Помогите с nginx rewrite
@ 2011-01-25 13:20 Yuri Khachaturyan
  2011-01-25 13:27 ` Денис Смирнов
  2011-01-25 13:32 ` Slava Dubrovskiy
  0 siblings, 2 replies; 28+ messages in thread
From: Yuri Khachaturyan @ 2011-01-25 13:20 UTC (permalink / raw)
  To: ALT Linux sysadmins' discussion

Добрый день!
Помогите пожалуйста с rewrite в nginx, никак не могу заставить
работать правило (переделываю из apache).

Вариант для apache:

                RewriteEngine on
                RewriteRule
^media/(.*)/(.*)/t/([0-9]+)/(.*)\.([a-z0-9]{3})$ media/$1/$2/$4.$5?$3
[QSA]


Попытка для nginx:

location /media {
   rewrite ^/media/(.*)/(.*)/t/([0-9]+)/(.*)\.([a-z0-9]{3})$
/media/$1/$2/$4.$5?$3 break;
}

Выдает ошибку:

Checking configuration sanity for nginx:  [emerg]: directive "rewrite"
is not terminated by ";" in /etc/nginx/sites-enabled.d/test.conf:9
configuration file /etc/nginx/nginx.conf test failed


Смысл:

надо из
/media/video/air_subjects/2010-01/01/t/123123/82.flv

получить

/media/video/air_subjects/2010-01/01/82.flv?123123



-- 
С уважением,
Хачатурян Юрий (yukh@yukh.ru)

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2011-01-27  7:58 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-25 13:20 [Sysadmins] Помогите с nginx rewrite Yuri Khachaturyan
2011-01-25 13:27 ` Денис Смирнов
2011-01-25 13:31   ` Yuri Khachaturyan
2011-01-25 13:32 ` Slava Dubrovskiy
2011-01-25 13:39   ` Yuri Khachaturyan
2011-01-25 15:52     ` Денис Смирнов
2011-01-25 15:56       ` Yuri Khachaturyan
2011-01-25 16:13         ` Yuriy Kashirin
2011-01-25 16:30           ` Yuri Khachaturyan
2011-01-26  3:09             ` Денис Смирнов
2011-01-25 16:38         ` Денис Смирнов
2011-01-25 16:42           ` Yuri Khachaturyan
2011-01-25 16:40         ` Денис Смирнов
2011-01-25 16:43           ` Yuri Khachaturyan
2011-01-25 18:17             ` Afanasov Dmitry
2011-01-25 18:21               ` Yuri Khachaturyan
2011-01-25 18:39                 ` Afanasov Dmitry
2011-01-25 18:43                   ` Yuri Khachaturyan
2011-01-25 18:47                     ` Afanasov Dmitry
2011-01-25 18:48                       ` Yuri Khachaturyan
2011-01-26  9:11                     ` Yuriy Kashirin
2011-01-26  9:26                       ` Yuri Khachaturyan
2011-01-26 12:48                         ` Slava Dubrovskiy
2011-01-27  3:59                           ` Дмитрий Дегтярев
2011-01-26  9:45                       ` Michael Shigorin
2011-01-27  7:58                         ` Yuriy Kashirin
2011-01-25 18:47                   ` Yuri Khachaturyan
2011-01-26  3:07             ` Денис Смирнов

ALT Linux sysadmins discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sysadmins/0 sysadmins/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sysadmins sysadmins/ http://lore.altlinux.org/sysadmins \
		sysadmins@lists.altlinux.org sysadmins@lists.altlinux.ru sysadmins@lists.altlinux.com
	public-inbox-index sysadmins

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sysadmins


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git