Open Kooooooma opened 8 years ago
@KomaBeyond Well, I didn't know nginx supports .htaccess files like apache httpd.
@agentzh well, actually it supports. could u make some tests and let echo can work in the .htaccess file ?
@KomaBeyond You mean some 3rd-party modules? I've been working on the nginx core for 7 years now and I never see such things in the standard nginx distributions, ever.
@agentzh Ah... I think may be we are not in the same topic now, so, let me paste my nginx config file and my .htaccess file down here, this will be show u how i used the .htaccess file in the nginx config file and then u will be know what i am talking about.
nginx config file contents:
server {
location / {
....
echo "hi, koma";
}
...
include "/path/to/htaccess/.htaccess";
}
.htaccess file contents:
location ~ /stream/view {
echo "hi, koma, see u again..";
}
Ha, that's really confusing.
So basically you must use the correct nginx syntax in the .htaccess
file. That's why naming it like this is already misleading (as everybody else uses Apache syntax there).
In your case I would guess you do not need the RegExp location there and try location /stream/view {
instead of location ~ /stream/view {
. Don't know whether this fixes the problem, but it is a good thing to change in any way.
BTW: You can place code parts into newline/code/newline
to show them nicely in Markdown here on GitHub.
Based on what you showed, the location
directive in your .htaccess file isn't inside a server
directive, but location
directives must be inside server
directives.
i had already installed echo module for my nginx, and also i can use the echo command in the main nginx config file nginx.conf. but when i use the seem command in my .htaccess file it dosent't work anymore.
please help me, thanks!