Eazy
Eazy

Reputation: 3492

nginx url rewrite rule

I have URL like this

http://domain/PROD_SHEP_PDF_Downloader/DownloadPdf?favorId=10100018565295&lang=ru

I want to rewrite this part PROD_SHEP_PDF_Downloader to this SHEP_PDF_Downloader so the result will be

http://domain/SHEP_PDF_Downloader/DownloadPdf?favorId=10100018565295&lang=ru

This rule doesn't work

   location /PROD_SHEP_PDF_Downloader/ {
      rewrite ^/PROD_SHEP_PDF_Downloader/(.*)  SHEP_PDF_Downloader/$1 break;
      proxy_pass http://localhost:85;
}

Upvotes: 3

Views: 327

Answers (1)

Tair
Tair

Reputation: 3809

Docs say that if you just want to change the URI prefix, you can use this:

location /name/ {
    proxy_pass http://127.0.0.1/remote/;
}

Upvotes: 1

Related Questions