-
Notifications
You must be signed in to change notification settings - Fork 76
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 http2 support in template.yml #405
Conversation
This works, I've tested, resulting config will be ``` server { listen 443 ssl http2; } ``` with `http2: true`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @orlovmyk!
The http2
parameter on the listen directive is deprecated (see https://nginx.org/en/docs/http/ngx_http_core_module.html#listen), and it was removed in #346. That being said, it's true that the change has only made it's way to the mainline
branch so far, so it makes sense to bring it back for the time being.
That being said, I don't quite think the parameter will work as is. If you see the current template on main
, you'll see the http2
parameter for the listen
directive is not there anymore https://github.com/nginxinc/ansible-role-nginx-config/blob/main/templates/http/core.j2#L139-L159. You can add it back with a couple changes by merging the change here https://github.com/nginxinc/ansible-role-nginx-config/blob/main/templates/http/core.j2#L139-L159 with the quic
parameter (you can configure either http2
or quic
). Once you do that, can you also add the parameter to the molecule test (you can easily revert the change made here to do that https://github.com/nginxinc/ansible-role-nginx-config/pull/346/files#diff-bc4d0c4551c2773138cb727ed62a97e7e37f37731b8f6a2c8fe715ae136fdfb6L551). Finally, I'd appreciate if you could update the changelog.
Thanks!
P.S: The CI/CD pipeline is failing atm but I'll hopefully have a fix for that early next week 😄
@alessfg You can close it as far it's deprectaed. I guess someone else struggling will just find this issue |
This is not working on Ubuntu 20.04. If I enabled the https2 directive, the ansible will generate the The given error
I installed with Nginx role
|
You are using the |
Let me check this @alessfg |
Currently, the CentOS stream have maximum the 1.24 version [root@host]# dnf module list nginx
Last metadata expiration check: 0:01:33 ago on Fri 17 May 2024 07:19:53 PM +07.
CentOS Stream 8 - AppStream
Name Stream Profiles Summary
nginx 1.14 [d] common [d] nginx webserver
nginx 1.16 common [d] nginx webserver
nginx 1.18 common [d] nginx webserver
nginx 1.20 common [d] nginx webserver
nginx 1.22 common nginx webserver
nginx 1.24 [e] common [d] nginx webserver
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled I was resolved this issue with ---
nginx_config_http_template_enable: true
nginx_config_http_template:
- template_file: 'http/default.conf.j2'
deployment_location: '/etc/nginx/conf.d/http_vhosts.conf'
backup: false
config:
servers:
- core:
root: '/srv/http'
server_name: "{{ inventory_hostname }}"
custom_directives:
- "{{ 'listen ' + ansible_host + ':80 reuseport http2;' }}" |
If I might suggest, and unless you 100% need to use CentOS 8, I would suggest switching to one of the officially supported distros and using the latest release ( |
✅ All required contributors have signed the F5 CLA for this PR. Thank you! |
I have hereby read the F5 CLA and agree to its terms |
This works, I've tested, resulting config will be
with
http2: true
Proposed changes
Describe the use case and detail of the change. If this PR addresses an issue on GitHub, make sure to include a link to that issue using one of the supported keywords here in this description (not in the title of the PR).
Checklist
Before creating a PR, run through this checklist and mark each as complete:
CONTRIBUTING
document.defaults/main/*.yml
,README.md
andCHANGELOG.md
).