[GH-ISSUE #223] Question: How to add redirect to default site #196

Closed
opened 2026-02-26 06:31:23 +03:00 by kerem · 0 comments
Owner

Originally created by @xannor on GitHub (Oct 31, 2019).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/223

I am not sure if this is possible but,

I want to add a default rewrite rule to the default site that will append a domain name to a non-domain request.

I.E. http://servername gets redirected to http://server.tld (possible to https in the future) I would liek this because I have a TLD for my local network but typing in server names is faster than the full name.

I have done this before with manual configuration by adding a (I may have this wrong but I believe it is close):

server_name "~^(?<servername>[^.]+)$";

location / {
rewrite ^ http://$servername.tld$request_uri permanent;
}

to the default server so it will first rewrite any request to the full name.

is this possible in proxy manager?

Bonus: This also could be a great config setting as well... Just fill out a default domain name and every request to the name only will be redirected.

Originally created by @xannor on GitHub (Oct 31, 2019). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/223 I am not sure if this is possible but, I want to add a default rewrite rule to the default site that will append a domain name to a non-domain request. I.E. http://servername gets redirected to http://server.tld (possible to https in the future) I would liek this because I have a TLD for my local network but typing in server names is faster than the full name. I have done this before with manual configuration by adding a (I may have this wrong but I believe it is close): server_name "~^(?&lt;servername>[^\.]+)$"; location / { rewrite ^ http://$servername.tld$request_uri permanent; } to the default server so it will first rewrite any request to the full name. is this possible in proxy manager? Bonus: This also could be a great config setting as well... Just fill out a default domain name and every request to the name only will be redirected.
kerem closed this issue 2026-02-26 06:31:23 +03:00
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#196
No description provided.