NGINX Dynamic Proxy Location with ID in the URL

by PinoyStackOverflower   Last Updated June 30, 2020 03:00 AM - source

I have this kind of URL in my web app - /sample/company/123/invoices/download/123

location /sample/company/ {
   root /myapp/public;
   include fastcgi_params;
   fastcgi_param SCRIPT_FILENAME $document_root/index.php;
   fastcgi_param SCRIPT_NAME /index.php;
   fastcgi_index index.php;
   fastcgi_pass my-backend:8000;
}

If i'm having that kind of URL all pages that has this URL /sample/company/ gets affected. I only wanted to make that rule only applicable if the URL is /sample/company/123/invoices/download/123. Take note that the 123 are dynamic, these are IDs.

I'm really new to NGINX.

Any help is greatly appreciated, thanks in advance!

Tags : nginx


Related Questions



nginx location not opening static site

Updated August 03, 2019 14:00 PM