[GH-ISSUE #2967] Custom location or Advanded configuration #2022

Closed
opened 2026-02-26 07:33:43 +03:00 by kerem · 1 comment
Owner

Originally created by @jdgabriel on GitHub (May 31, 2023).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2967

Hi, devs!

I'm trying to make a setting to omit part of the url to the client.

https://company_name.my-domain.com/bucket/company_name/file.doc
change for:
https://company_name.my-domain.com/file.doc

image

I tried to do it by proxy_pass in the location with regex

image

location ~ ^/([^/]+)/(.*) {
    set $prefix "bucket";
    proxy_pass $prefix$2;
    proxy_set_header Host $host;
}

How do I get this kind of configuration in nginx proxy manager?

Originally created by @jdgabriel on GitHub (May 31, 2023). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2967 Hi, devs! I'm trying to make a setting to omit part of the url to the client. https://`company_name`.my-domain.com/`bucket/company_name`/file.doc change for: https://`company_name`.my-domain.com/file.doc ![image](https://github.com/NginxProxyManager/nginx-proxy-manager/assets/47068314/e7acf589-0fef-4e07-ae46-8d2ee5f698c4) I tried to do it by proxy_pass in the location with regex ![image](https://github.com/NginxProxyManager/nginx-proxy-manager/assets/47068314/0905ec29-f946-4215-8bd5-30cf89dd20bc) ``` location ~ ^/([^/]+)/(.*) { set $prefix "bucket"; proxy_pass $prefix$2; proxy_set_header Host $host; } ``` How do I get this kind of configuration in nginx proxy manager?
kerem closed this issue 2026-02-26 07:33:43 +03:00
Author
Owner

@jdgabriel commented on GitHub (Jun 6, 2023):

I find the solution:
image

In Advanced set the configuration, for add prefix to proxy pass.
Use / or path to u want for this.
Also works with RegEx

location / {
     set $bucket my_prefix;
     rewrite ^/(.*)$ /$bucket/$1 break;
     proxy_pass http://$server:$port; 
}
<!-- gh-comment-id:1579114131 --> @jdgabriel commented on GitHub (Jun 6, 2023): I find the solution: ![image](https://github.com/NginxProxyManager/nginx-proxy-manager/assets/47068314/9cb0e4b6-b034-4e39-bb63-3df61638407f) In `Advanced` set the configuration, for add prefix to proxy pass. Use `/` or `path to u want` for this. `Also works with RegEx` ``` location / { set $bucket my_prefix; rewrite ^/(.*)$ /$bucket/$1 break; proxy_pass http://$server:$port; } ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#2022
No description provided.