Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Https redirection with one server #17

Closed
MrHash opened this issue Apr 19, 2017 · 10 comments
Closed

Https redirection with one server #17

MrHash opened this issue Apr 19, 2017 · 10 comments

Comments

@MrHash
Copy link
Contributor

MrHash commented Apr 19, 2017

I'm not 100% certain on the behaviour but it seems to me like the NGINX_REDIRECT_PORT80 setting is not effective with a single server definition e.g.:

NGINX_REDIRECT_PORT80: "true"
SERVER1REVERSE_PROXY_LOCATION1: /
SERVER1REVERSE_PROXY_PASS1: http://nginx:8000
SERVER1HTTP_ENABLED: "false"
SERVER1HTTPS_ENABLED: "true"
SERVER1PROXY_APPLICATION: custom
SERVER1REVERSE_PROXY_HEADER1FIELD1: X-Forwarded-Host killer.app
SERVER1REVERSE_PROXY_HEADER1FIELD2: X-Forwarded-Proto https
SERVER1REVERSE_PROXY_HEADER1FIELD3: X-Forwarded-For $$proxy_add_x_forwarded_for
@blacklabelops
Copy link
Collaborator

I will check this issue!

blacklabelops pushed a commit that referenced this issue Apr 19, 2017
* origin/2.2:
  Fixing #17 missing configuration for port-80-redirect.
  New readme and recomendations for versions.
@blacklabelops
Copy link
Collaborator

Fixed in version 2.2 and latest.

blacklabelops pushed a commit that referenced this issue Apr 19, 2017
* origin/2.2:
  Fixing #17 missing configuration for port-80-redirect.
  New readme and recomendations for versions.
@blacklabelops
Copy link
Collaborator

The generated config for port redirection had been directly deleted by the next operation. Must have been a mistake when making version 2.2 where i moved the generated config to folder /etc/nginx

@MrHash
Copy link
Contributor Author

MrHash commented May 18, 2017

Hey looks like i'm still getting some strangeness on my side with latest tag. Looking into it some more.. suspect a bug in https://github.com/blacklabelops/nginx/blob/master/imagescripts/port_redirect.sh - may need to reopen

@blacklabelops
Copy link
Collaborator

I will recheck.

@blacklabelops
Copy link
Collaborator

Hello Hash,

I rechecked the development tag and the issue seems fixed. This fix won't be available on the latest tag until version 2.2 is released.

@MrHash
Copy link
Contributor Author

MrHash commented Jun 3, 2017

Hey thanks for the recheck. Could you just clarify what is happening in the port redirect script at https://github.com/blacklabelops/nginx/blob/master/imagescripts/port_redirect.sh#L16-L18 please? It seems to me that if the server name is not assigned then there is no effective redirect.

@blacklabelops
Copy link
Collaborator

blacklabelops commented Jun 3, 2017

That's the loop-end check for enumerated variables. You never know how many envs of the kind SERVER1..., SERVER2..., SERVER3.. there really are. So I start to enumerate env-variable names and check if there is actually an env variable with the given name. If this does not work for you then:

  • You did not enumerate
    Or
  • I did check an env that you actually do not use in your context

Maybe SERVER_NAMEis not the always required env variable. Which one should I check?

@MrHash
Copy link
Contributor Author

MrHash commented Jun 3, 2017

Ok I am not using a SERVER1SERVER_NAME setting in my configuration so maybe that's why?

@blacklabelops
Copy link
Collaborator

yes

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants