nginx-proxy-manager icon indicating copy to clipboard operation
nginx-proxy-manager copied to clipboard

Redirect Issue

Open GeneralLuzi opened this issue 7 years ago • 12 comments

Hi,

the following szenario I would like to achive: All of the following should point to the same URL https://www.subdomain.domain.tld:

  • https://www.subdomain.domain.tld
  • http://www.subdomain.domain.tld
  • https://subdomain.domain.tld
  • http://subdomain.domain.tld

1) Szenarios for Proxy Host: 1a) Szenario: https://www.subdomain.domain.tld --> create Reverse Proxy Host inkl. SSL 1b) Szenario: http://www.subdomain.domain.tld --> without ssl --> Update Reverse Proxy from 1a) to Force SSL

2) Szenario for Redirect Host 2a) Szenario: http://subdomain.domain.tld -->create Redirect Host (point to URL from 1a) 2b) Szenario: https://subdomain.domain.tld --> update Redirect Host from 2a) to SSL + Force SSL

Testing: 1a) works as specified 1b) works as specified 2a) does not work: url is redirected to https://http//subdomain.domain.tld 2b) does not work - like 2a)

If if I try to disable "Force SSL" within the Redirect Host but it does not save this new setting. (the same as specifed for http/2 in #61 --> perhaps there should be a new issue opened?!)

I deleted the Redirect Host from 2) and created the a new one with SSL settings, but without "Forced SSL". Same picture.

Can some verify my observation? Or do I missunderstand something how to use this manager?

Thanks a lot!

GeneralLuzi avatar Feb 02 '19 13:02 GeneralLuzi

update: the relevant conf within redirection_host folder has the following specified:

  • return 301 $scheme://https://www.subdomain.domain.tld$request_uri;

This might cause this issue!

If I delete the scheme "https://" within my redirect, all desired things work. Perhaps it will be good to specify this somewhere in the GUI for other noobs like me ;) Alternatively: replace https:// or http:// if it is present.

GeneralLuzi avatar Feb 02 '19 13:02 GeneralLuzi

Regarding the location https://http//subdomain.domain.tld, I just tested myself and couldn't replicate this outcome.

TL;DR for below: please try again with the latest docker image.

To simplify the setup required, you just want to

  1. create a Redirection Host to from source subdomain.domain.tld to destination www.subdomain.domain.tld
  2. create a Proxy Host from www.subdomain.domain.tld to upstream server.

When it comes to redirecting and SSL, when the destination http server supports both HTTP and HTTPS connections (as a Proxy Host does), your Redirection Host doesn't need to Force SSL because you'll want to leave that determination up to the destination. However if the destination server only supported HTTPS then you'd want to force SSL before it even got to the destination.

A redirection host will forward to the destination on the same protocol scheme requested, and if force SSL is on then it will redirect to that first.

Btw, when I say that the server supports HTTP and HTTPS I mean from an open port point of view, not from a Proxy Host configured to forward both point of view.

jc21 avatar Feb 18 '19 00:02 jc21

I am having this issue as well. I want to redirect to an https but I get https://http//url. The URL is an IP address that requires https.

mackcoding avatar Feb 23 '19 05:02 mackcoding

I'm going to need to see the configuration for these hosts.

  1. Screenshot the edit proxy host dialog, with the domain name removed for privacy
  2. Find the nginx configuration for that host in your data/nginx/proxy_host folder and attach that here, changing the domain name for privacy

jc21 avatar Feb 25 '19 00:02 jc21

I still have the same issue. forwarding to another domain adds https//www.

happy to provide any config files if needed Bildschirmfoto 2021-02-12 um 08 39 20 Bildschirmfoto 2021-02-12 um 08 40 24

toupou avatar Feb 12 '21 07:02 toupou

Shortly after your comment PR https://github.com/jc21/nginx-proxy-manager/pull/883 was merged. I'm assuming this fixed the issue. If it did not, let me know and I can reopen the issue.

chaptergy avatar May 10 '21 20:05 chaptergy

I am having this issue as well. I want to redirect to an https but I get https://http//url. The URL is an IP address that requires https.

I am also having this issue with redirection hosts. Attached are some screenshots, I hope that it's useful. Please kindly help!

CleanShot 2023-0105 at 19 55 42@2x CleanShot 2023-0105 at 19 55 48@2x CleanShot 2023-0105 at 19 57 01@2x

rockpham avatar Jan 05 '23 13:01 rockpham

I know this is a zombie issue but I am also running into this with the same exact result as the poster above me.

Cruv avatar Jan 30 '23 21:01 Cruv

I got the redirection host working by using 301, instead of 308

ảnh

rockpham avatar Feb 22 '23 09:02 rockpham

Issue still persist in v2.11.3 using 308 still getting double https:// on a redirection host.

Barina avatar Jul 29 '24 14:07 Barina

I found a solution. It's not an Issue with nginx-proxy-manager.

The problem is, that a permanent redirect is cached a Webbrowser.

You can test it using curl and check the Location: header curl -D - YOUR_URL

I recommend changing HTTP Code to 307 Temporary Redirect to prevent this.

  1. Open Dev Tools in your browser (F12)
  2. navigate to Network tab
  3. check disable cache
  4. try your redirect url again
  5. re-enable cache (if u want)

BaconFist avatar Oct 18 '24 23:10 BaconFist

As discussed in this issue, I think this is not possible with Nginx Proxy Manager. See this reddit post

Chaxiraxi avatar Oct 27 '24 21:10 Chaxiraxi