Reputation: 452
I'm trying to pass requests from address helpme,com/donor/2014/12/07/Name on the other server.
URL like the: /donor/2014/12/07/Mike
need to convert to a query type of: /donor.php?yyyy=2014&mm=12&dd=07&donor=Name.
Now i have:
location ~* ^/donor/+$ {
rewrite ^/(.*) /donor.php?yyyy=$1&mm=$2&dd=$3&donor=$4 break;
proxy_pass http://164,151,234,168;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Help me please.
Upvotes: 0
Views: 201
Reputation: 2244
The regex for that should be (untested) something like /donor/(\d{4})/(\d{2})/(\d{2})/(.+)
.
The use of commas (,) instead of periods (.) for the hostname/IP seems wrong, though. As far as I know the same character is used everywhere….
Upvotes: 1