wandenberg / nginx-push-stream-module

A pure stream http push technology for your Nginx setup. Comet made easy and really scalable.
Other
2.22k stars 295 forks source link

Url structure #122

Closed pokal4u closed 10 years ago

pokal4u commented 10 years ago

Hi, I am using nginx push stream module How can i access urls without create any folder Ex: http://www.domain.com/srinivas/ http://www.domain.com/nagaraju/ http://www.domain.com/ravi/ ....... Thanks

tarikozket commented 10 years ago

What are you trying to do exactly? What is your purpose, tell some please...

pokal4u commented 10 years ago

Hi, We are trying to minimize url structure for seo purpose my actual url like ------http://www.domain.com/profile.php?name=srinivas I need above url like ---http://www.domain.com/srinivas/ without creating a 'srinivas' folder

Thanks

tarikozket commented 10 years ago

You can use rewrite,

rewrite ^/([A-z0-9]+)/$ /profile.php?name=$1 last;

but it's not a related question with nginx-push-stream-module. Please use stackoverflow.com instead.

AlexeyKupershtokh commented 10 years ago

It does not relate to the module.

Probably you should try nginx rewrite module: http://nginx.org/en/docs/http/ngx_http_rewrite_module.html You can find the following example on the page which is probably almost what you need:

If a replacement string includes the new request arguments, the previous request arguments
 are appended after them. If this is undesired, putting a question mark at the end of a
 replacement string avoids having them appended, for example:

    rewrite ^/users/(.*)$ /show?user=$1? last;

If a regular expression includes the “}” or “;” characters, the whole expressions should
 be enclosed in single or double quotes.
wandenberg commented 10 years ago

Hi @pokal4u

you can do something like this

location ~ ^(/.*)/$ {
  push_stream_channels_path         $1;
...
}

when you access http://www.domain.com/srinivas/ the $1 will assume the value /srinivas

Regards