nginx: rewrite URL but have original URL stored in access.log as 200
- by mhambra
I'm setting up a link tracking system, which (temporarily) involves adding /link/id/ in front of URL (like http://server/data/id/publication/id/).
rewrite data/id/(.*) http://server/$1;
The request is logged as:
ip - - [17/Nov/2011:10:07:19 +0300] "GET /data/id/publication/id.html HTTP/1.1" 302 154 "-" "UA"`
For some reason (keeping the compatibility with AWStats) it is wanted to have 200 logged instead of 302. (nginx allows to get 301 code out of box with permanent option, but thats inappropriate too)
What are my options here?
Will the combination of location { } and rewrite do the job?