Nginx forward slash issues
I've googled a lot and found a few workarounds, but you have to define each directory.
- In Apache: example.com/hi -> example.com/hi/
- In nginx: example.com/hi -> Firefox cannot connect to server at example.com:8888
where 8888 is what Apache is listening on (nginx: 80 -> localhost: 8888)
Any ideas how to fix this and make it just forward normally as a folder?
+2
a source to share
4 answers
This is the magic that works best for me:
try_files $uri $uri/ @redirect;
location @redirect {
if ($uri !~ '/$') {
return 301 $uri/$is_args$args;
}
}
The if statement can be safe: http://wiki.nginx.org/IfIsEvil
0
a source to share