-
-
Notifications
You must be signed in to change notification settings - Fork 881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rewrite_to_https_port setting support #789
Conversation
f8d0e96
to
a23047c
Compare
a23047c
to
25b1f4b
Compare
Hi @invidian, can you add tests for this PR? |
I'm in favor of this, but just wondering, what do people think about changing the name of the @invidian: are you able to add tests and are you still interested in pushing this PR along? If not, I can take my best stab at reworking it when there's time, but no promises. |
Hi, sorry for not updating for a long time. Unfortunately, I'm not familiar with unit test, so I can't provide them until I find time to learn how to do it. But I just ticked "Allow edits from maintainers", so you should be able to push tests to that PR. That would be nice to push this PR, as it covers missing functionality, which is quite often used in my opinion. In my opinion, renaming it to |
It would mostly be modifying this test: https://github.com/voxpupuli/puppet-nginx/blob/master/spec/defines/resource_vhost_spec.rb#L234 |
The interesting thing is that this already seems to be there in vhost_ssl_header.erb
So I think if @ssl_port is set, this will already behave as you expect. |
In general, nginx frowns upon using 'if' statements, per: They also have a recommended 'force-http-to-https' config statement, per: Given that, perhaps there should be a more stringent "force_all_to_ssl" or similar option? That would replace the previous if-statement and various :80 stanzas to just use:
|
@invidian: rereading, and I see what you're saying now, I'll try to add this to my rework as well. |
@wyardley Thank you for your effort resolving this. Your pull request looks good, I hope you will be able to finish it. |
@invidian: thanks -- take a look, I've made some additional changes. |
#957 looks OK. Feel free to close that one if your PR gets merged. |
This functionality now exists in the (merged) #957 |
In situation, when nginx is behind port multiplexer, ex. sslh, so nginx ssl is listening on
8443
and multiplexer on443
, I was unable to set proper redirect to SSL. With this patch, we can set on which port we want to be redirected to SSL.First if in template is to prevent using
@ssl_port
when@rewrite_to_https_port
is defined. Second if is the same as for@ssl_port