- Previous thread: Problem with new Passenger Module and rewrite rules
- Next thread: nginx serving wrong website under proxy_cache
- Threads sorted by date: nginx 200904
still sorta confused about running those two together. my end goal is
to have simple urls like:
wiki.something.com/TheArticleThingie
right now under my current configs i get urls that look like this:
wiki.something.com/index.php/TheArticleThingie
which is *very close* but not quite.
To prove that i've done my share of "just google it"
i tried to cut&paste the configs from
http://wiki.nginx.org/NginxMediaWiki and when i do an nginx -t it
gives and error:
--snip--snip--snip--
tina:/etc/nginx/vhosts# nginx -t
2009/04/28 20:32:25 [emerg] 1172#0: invalid number of arguments in
"rewrite" directive in /etc/nginx/vhosts/wiki.sunlightlabs.com.conf:22
2009/04/28 20:32:25 [emerg] 1172#0: the configuration file
/etc/nginx/nginx.conf test failed
--snip--snip--snip--
--snip--snip--snip--
server {
listen 80;
server_name wiki.something.com;
## http {
root /var/www/wiki.something.com/www/;
location / {
index index.php;
if ($uri ~ "index.php/") {
rewrite ^/index.php/(.+) /index.php?title=$1 last;
}
if (!-e $request_filename) {
rewrite ^/(.+) /index.php?title=$1 last;
}
}
# .php5 sent to php5
location ~ .*\.php$ {
include /etc/nginx/fastcgi.conf;
fastcgi_index index.php;
if ($uri !~ "^/images/" ) {
fastcgi_pass 127.0.0.1:10000;
}
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_param SCRIPT_NAME /index.php;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param PHP_SELF /index.php;
fastcgi_param SCRIPT_URL /index.php;
}
access_log /var/log/nginx/something_wiki_access.log combined;
error_log /var/log/nginx/something_wiki_error.log error;
## }
}
# vim: set ft=nginx:
--snip--snip--snip--
--timball
--
GPG key available on pgpkeys.mit.edu
pub 1024D/511FBD54 2001-07-23 Timothy Lu Hu Ball
Key fingerprint = B579 29B0 F6C8 C7AA 3840 E053 FE02 BB97 511F BD54
to have simple urls like:
wiki.something.com/TheArticleThingie
right now under my current configs i get urls that look like this:
wiki.something.com/index.php/TheArticleThingie
which is *very close* but not quite.
To prove that i've done my share of "just google it"
i tried to cut&paste the configs from
http://wiki.nginx.org/NginxMediaWiki and when i do an nginx -t it
gives and error:
--snip--snip--snip--
tina:/etc/nginx/vhosts# nginx -t
2009/04/28 20:32:25 [emerg] 1172#0: invalid number of arguments in
"rewrite" directive in /etc/nginx/vhosts/wiki.sunlightlabs.com.conf:22
2009/04/28 20:32:25 [emerg] 1172#0: the configuration file
/etc/nginx/nginx.conf test failed
--snip--snip--snip--
--snip--snip--snip--
server {
listen 80;
server_name wiki.something.com;
## http {
root /var/www/wiki.something.com/www/;
location / {
index index.php;
if ($uri ~ "index.php/") {
rewrite ^/index.php/(.+) /index.php?title=$1 last;
}
if (!-e $request_filename) {
rewrite ^/(.+) /index.php?title=$1 last;
}
}
# .php5 sent to php5
location ~ .*\.php$ {
include /etc/nginx/fastcgi.conf;
fastcgi_index index.php;
if ($uri !~ "^/images/" ) {
fastcgi_pass 127.0.0.1:10000;
}
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_param SCRIPT_NAME /index.php;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param PHP_SELF /index.php;
fastcgi_param SCRIPT_URL /index.php;
}
access_log /var/log/nginx/something_wiki_access.log combined;
error_log /var/log/nginx/something_wiki_error.log error;
## }
}
# vim: set ft=nginx:
--snip--snip--snip--
--timball
--
GPG key available on pgpkeys.mit.edu
pub 1024D/511FBD54 2001-07-23 Timothy Lu Hu Ball
Key fingerprint = B579 29B0 F6C8 C7AA 3840 E053 FE02 BB97 511F BD54
On Tue, Apr 28, 2009 at 1:45 PM, Timothy Ball wrote:
> still sorta confused about running those two together. my end goal is
> to have simple urls like:
>
> =C2=A0 wiki.something.com/TheArticleThingie
>
> right now under my current configs i get urls that look like this:
>
> =C2=A0 wiki.something.com/index.php/TheArticleThingie
>
> which is *very close* but not quite.
>
> To prove that i've done my share of "just google it"
>
> i tried to cut&paste the configs from
> http://wiki.nginx.org/NginxMediaWiki and when i do an nginx -t it
> gives and error:
>
this is all i have:
rewrite ^/wiki/([^?]*)(?:\?(.*))? /mediawiki/index.php?title=3D$1&$=
2 last;
rewrite ^/wiki /mediawiki/index.php last;
of course, that assumes
a) mediawiki is installed in /mediawiki
b) your "public" prefix is /wiki
You want no /wiki in the mix, so I am not sure how that would work
exactly. I would think it might become a circular rewrite.
You could take out /wiki in my example and try it out.
try_files would be another one to try, but that won't work; mediawiki
wants the index.php?title=3D stuff in there.
> still sorta confused about running those two together. my end goal is
> to have simple urls like:
>
> =C2=A0 wiki.something.com/TheArticleThingie
>
> right now under my current configs i get urls that look like this:
>
> =C2=A0 wiki.something.com/index.php/TheArticleThingie
>
> which is *very close* but not quite.
>
> To prove that i've done my share of "just google it"
>
> i tried to cut&paste the configs from
> http://wiki.nginx.org/NginxMediaWiki and when i do an nginx -t it
> gives and error:
>
this is all i have:
rewrite ^/wiki/([^?]*)(?:\?(.*))? /mediawiki/index.php?title=3D$1&$=
2 last;
rewrite ^/wiki /mediawiki/index.php last;
of course, that assumes
a) mediawiki is installed in /mediawiki
b) your "public" prefix is /wiki
You want no /wiki in the mix, so I am not sure how that would work
exactly. I would think it might become a circular rewrite.
You could take out /wiki in my example and try it out.
try_files would be another one to try, but that won't work; mediawiki
wants the index.php?title=3D stuff in there.
On Tue, 2009-04-28 at 16:45 -0400, Timothy Ball wrote:
> still sorta confused about running those two together. my end goal is
> to have simple urls like:
>
> wiki.something.com/TheArticleThingie
>
> right now under my current configs i get urls that look like this:
>
> wiki.something.com/index.php/TheArticleThingie
>
> which is *very close* but not quite.
>
> To prove that i've done my share of "just google it"
>
> i tried to cut&paste the configs from
> http://wiki.nginx.org/NginxMediaWiki and when i do an nginx -t it
Please try the second example on that page and let me know how that
works. That's the config I use for the Nginx wiki itself, so I expect
it works =)
Cliff
> still sorta confused about running those two together. my end goal is
> to have simple urls like:
>
> wiki.something.com/TheArticleThingie
>
> right now under my current configs i get urls that look like this:
>
> wiki.something.com/index.php/TheArticleThingie
>
> which is *very close* but not quite.
>
> To prove that i've done my share of "just google it"
>
> i tried to cut&paste the configs from
> http://wiki.nginx.org/NginxMediaWiki and when i do an nginx -t it
Please try the second example on that page and let me know how that
works. That's the config I use for the Nginx wiki itself, so I expect
it works =)
Cliff
On Tue, Apr 28, 2009 at 04:45:17PM -0400, Timothy Ball wrote:
> still sorta confused about running those two together. my end goal is
> to have simple urls like:
>
> wiki.something.com/TheArticleThingie
>
> right now under my current configs i get urls that look like this:
>
> wiki.something.com/index.php/TheArticleThingie
>
> which is *very close* but not quite.
>
> To prove that i've done my share of "just google it"
>
> i tried to cut&paste the configs from
> http://wiki.nginx.org/NginxMediaWiki and when i do an nginx -t it
> gives and error:
>
> --snip--snip--snip--
> tina:/etc/nginx/vhosts# nginx -t
> 2009/04/28 20:32:25 [emerg] 1172#0: invalid number of arguments in
> "rewrite" directive in /etc/nginx/vhosts/wiki.sunlightlabs.com.conf:22
> 2009/04/28 20:32:25 [emerg] 1172#0: the configuration file
> /etc/nginx/nginx.conf test failed
> --snip--snip--snip--
>
> --snip--snip--snip--
> server {
> listen 80;
> server_name wiki.something.com;
>
> ## http {
> root /var/www/wiki.something.com/www/;
>
> location / {
> index index.php;
>
> if ($uri ~ "index.php/") {
> rewrite ^/index.php/(.+) /index.php?title=$1 last;
> }
>
> if (!-e $request_filename) {
> rewrite ^/(.+) /index.php?title=$1 last;
> }
> }
>
> # .php5 sent to php5
> location ~ .*\.php$ {
> include /etc/nginx/fastcgi.conf;
> fastcgi_index index.php;
>
> if ($uri !~ "^/images/" ) {
> fastcgi_pass 127.0.0.1:10000;
> }
> fastcgi_param SCRIPT_FILENAME $document_root/index.php;
> fastcgi_param SCRIPT_NAME /index.php;
> fastcgi_param PATH_INFO $fastcgi_script_name;
> fastcgi_param PHP_SELF /index.php;
> fastcgi_param SCRIPT_URL /index.php;
> }
> access_log /var/log/nginx/something_wiki_access.log combined;
> error_log /var/log/nginx/something_wiki_error.log error;
>
> ## }
> }
> # vim: set ft=nginx:
If you have "if ($uri" in configuration, this means that your configuraiton
is far from optimal and has hidden agendas.
location / {
try_files $uri ${uri}index.php /index.php?title=$uri;
}
location /images/ {
# empty
}
location ~ ^/index.php/(.+) {
rewrite ^/index.php/(.+) /index.php?title=$1 last;
}
location ~ .*\.php$ {
fastcgi_pass 127.0.0.1:10000;
...
}
--
Igor Sysoev
http://sysoev.ru/en/
> still sorta confused about running those two together. my end goal is
> to have simple urls like:
>
> wiki.something.com/TheArticleThingie
>
> right now under my current configs i get urls that look like this:
>
> wiki.something.com/index.php/TheArticleThingie
>
> which is *very close* but not quite.
>
> To prove that i've done my share of "just google it"
>
> i tried to cut&paste the configs from
> http://wiki.nginx.org/NginxMediaWiki and when i do an nginx -t it
> gives and error:
>
> --snip--snip--snip--
> tina:/etc/nginx/vhosts# nginx -t
> 2009/04/28 20:32:25 [emerg] 1172#0: invalid number of arguments in
> "rewrite" directive in /etc/nginx/vhosts/wiki.sunlightlabs.com.conf:22
> 2009/04/28 20:32:25 [emerg] 1172#0: the configuration file
> /etc/nginx/nginx.conf test failed
> --snip--snip--snip--
>
> --snip--snip--snip--
> server {
> listen 80;
> server_name wiki.something.com;
>
> ## http {
> root /var/www/wiki.something.com/www/;
>
> location / {
> index index.php;
>
> if ($uri ~ "index.php/") {
> rewrite ^/index.php/(.+) /index.php?title=$1 last;
> }
>
> if (!-e $request_filename) {
> rewrite ^/(.+) /index.php?title=$1 last;
> }
> }
>
> # .php5 sent to php5
> location ~ .*\.php$ {
> include /etc/nginx/fastcgi.conf;
> fastcgi_index index.php;
>
> if ($uri !~ "^/images/" ) {
> fastcgi_pass 127.0.0.1:10000;
> }
> fastcgi_param SCRIPT_FILENAME $document_root/index.php;
> fastcgi_param SCRIPT_NAME /index.php;
> fastcgi_param PATH_INFO $fastcgi_script_name;
> fastcgi_param PHP_SELF /index.php;
> fastcgi_param SCRIPT_URL /index.php;
> }
> access_log /var/log/nginx/something_wiki_access.log combined;
> error_log /var/log/nginx/something_wiki_error.log error;
>
> ## }
> }
> # vim: set ft=nginx:
If you have "if ($uri" in configuration, this means that your configuraiton
is far from optimal and has hidden agendas.
location / {
try_files $uri ${uri}index.php /index.php?title=$uri;
}
location /images/ {
# empty
}
location ~ ^/index.php/(.+) {
rewrite ^/index.php/(.+) /index.php?title=$1 last;
}
location ~ .*\.php$ {
fastcgi_pass 127.0.0.1:10000;
...
}
--
Igor Sysoev
http://sysoev.ru/en/
On Tue, Apr 28, 2009 at 02:20:32PM -0700, Cliff Wells wrote:
> On Tue, 2009-04-28 at 16:45 -0400, Timothy Ball wrote:
> > still sorta confused about running those two together. my end goal is
> > to have simple urls like:
> >
> > wiki.something.com/TheArticleThingie
> >
> > right now under my current configs i get urls that look like this:
> >
> > wiki.something.com/index.php/TheArticleThingie
> >
> > which is *very close* but not quite.
> >
> > To prove that i've done my share of "just google it"
> >
> > i tried to cut&paste the configs from
> > http://wiki.nginx.org/NginxMediaWiki and when i do an nginx -t it
>
> Please try the second example on that page and let me know how that
> works. That's the config I use for the Nginx wiki itself, so I expect
> it works =)
Please change this ugly stuff:
location ~ .*\.php5?$ {
include fastcgi.conf;
fastcgi_index index.php;
if ( $uri !~ "^/images/" ) {
fastcgi_pass 127.0.1.1:1026;
}
}
to something like this:
location ~ \.php5?$ {
fastcgi_pass 127.0.1.1:1026;
include fastcgi.conf;
}
location /images/ {
}
--
Igor Sysoev
http://sysoev.ru/en/
> On Tue, 2009-04-28 at 16:45 -0400, Timothy Ball wrote:
> > still sorta confused about running those two together. my end goal is
> > to have simple urls like:
> >
> > wiki.something.com/TheArticleThingie
> >
> > right now under my current configs i get urls that look like this:
> >
> > wiki.something.com/index.php/TheArticleThingie
> >
> > which is *very close* but not quite.
> >
> > To prove that i've done my share of "just google it"
> >
> > i tried to cut&paste the configs from
> > http://wiki.nginx.org/NginxMediaWiki and when i do an nginx -t it
>
> Please try the second example on that page and let me know how that
> works. That's the config I use for the Nginx wiki itself, so I expect
> it works =)
Please change this ugly stuff:
location ~ .*\.php5?$ {
include fastcgi.conf;
fastcgi_index index.php;
if ( $uri !~ "^/images/" ) {
fastcgi_pass 127.0.1.1:1026;
}
}
to something like this:
location ~ \.php5?$ {
fastcgi_pass 127.0.1.1:1026;
include fastcgi.conf;
}
location /images/ {
}
--
Igor Sysoev
http://sysoev.ru/en/
On Wed, 2009-04-29 at 10:29 +0400, Igor Sysoev wrote:
> On Tue, Apr 28, 2009 at 02:20:32PM -0700, Cliff Wells wrote:
>
> > On Tue, 2009-04-28 at 16:45 -0400, Timothy Ball wrote:
> > > still sorta confused about running those two together. my end goal is
> > > to have simple urls like:
> > >
> > > wiki.something.com/TheArticleThingie
> > >
> > > right now under my current configs i get urls that look like this:
> > >
> > > wiki.something.com/index.php/TheArticleThingie
> > >
> > > which is *very close* but not quite.
> > >
> > > To prove that i've done my share of "just google it"
> > >
> > > i tried to cut&paste the configs from
> > > http://wiki.nginx.org/NginxMediaWiki and when i do an nginx -t it
> >
> > Please try the second example on that page and let me know how that
> > works. That's the config I use for the Nginx wiki itself, so I expect
> > it works =)
>
> Please change this ugly stuff:
>
> location ~ .*\.php5?$ {
> include fastcgi.conf;
> fastcgi_index index.php;
> if ( $uri !~ "^/images/" ) {
> fastcgi_pass 127.0.1.1:1026;
> }
> }
>
> to something like this:
>
> location ~ \.php5?$ {
> fastcgi_pass 127.0.1.1:1026;
> include fastcgi.conf;
> }
>
> location /images/ {
> }
>
I've just removed the entire first example. I don't know that it's
worked for anyone.
Cliff
> On Tue, Apr 28, 2009 at 02:20:32PM -0700, Cliff Wells wrote:
>
> > On Tue, 2009-04-28 at 16:45 -0400, Timothy Ball wrote:
> > > still sorta confused about running those two together. my end goal is
> > > to have simple urls like:
> > >
> > > wiki.something.com/TheArticleThingie
> > >
> > > right now under my current configs i get urls that look like this:
> > >
> > > wiki.something.com/index.php/TheArticleThingie
> > >
> > > which is *very close* but not quite.
> > >
> > > To prove that i've done my share of "just google it"
> > >
> > > i tried to cut&paste the configs from
> > > http://wiki.nginx.org/NginxMediaWiki and when i do an nginx -t it
> >
> > Please try the second example on that page and let me know how that
> > works. That's the config I use for the Nginx wiki itself, so I expect
> > it works =)
>
> Please change this ugly stuff:
>
> location ~ .*\.php5?$ {
> include fastcgi.conf;
> fastcgi_index index.php;
> if ( $uri !~ "^/images/" ) {
> fastcgi_pass 127.0.1.1:1026;
> }
> }
>
> to something like this:
>
> location ~ \.php5?$ {
> fastcgi_pass 127.0.1.1:1026;
> include fastcgi.conf;
> }
>
> location /images/ {
> }
>
I've just removed the entire first example. I don't know that it's
worked for anyone.
Cliff
Related Threads
- arch-general - Hard disc clicks - archlinux
- Getting back 1.2 plugin routing in 1.3 :: (1.3.3 to be exact) :: Round 1 - cakephp
- page fault in e1000_clear_hw_cntrs_base_generic() during SIOCAIFADDR - freebsd
- Show SQL Statement in Log - ofbiz
- Hendrix - Very - firefox
- AMD64 Buildworld error in i386-elf - freebsd
- Classpath resource endpoint? - apachecamel
- releng_8_1 tinderbox - failure on arm/arm - freebsd
- dhcpd pid exists but process not running - dhcp
- users - Basic basic basic question - openoffice
- ForeignKey, Index conflict going from 1.0 to 1.2 - django
- svn commit: r992152 - in /activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp: ConsumerTest.cs ForgeinMessageTransformatio - activemq