Hot answers tagged


The URLs in are generated by the application software running on it, or tracking scripts you get from an external source. You cannot use nginx to make anything to those URLs, since nginx only handles URLs that come to the server, not the URLs that the application software generates.


Just turned on rewrite log and debug log and found out that your problem is in rewriting to -. Unlike Apache, nginx takes it literally and rewrite request URI to string -. Then it cannot find any location block that matches this URI and uses it's magic configuration "" that just happens to have all the server rewrite rules. So new URI goes through all the ...


If is evil but as the documentation states, it is ok for rewrite ... last statements. However, an alternative approach (which still extracts just a portion of the $uri) is to use a named location at the end of the try_files statement: location /qa/ { try_files $uri $uri/ @qa; } location @qa { rewrite ^/qa/(.*)$ /qa/index.php?qa-rewrite=$1 last; } ...

Only top voted, non community-wiki answers of a minimum length are eligible