Skip to content
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

feat(gateway): enable IPv6 in each listen directive #3023

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions gateway/conf.d/shellhub.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
server {
{{ if and (bool (env.Getenv "SHELLHUB_AUTO_SSL")) (ne (env.Getenv "SHELLHUB_ENV") "development") -}}
listen 443 ssl{{ if bool (env.Getenv "SHELLHUB_PROXY") }} proxy_protocol{{ end }};
listen [::]:443 ssl{{ if bool (env.Getenv "SHELLHUB_PROXY") }} proxy_protocol{{ end }};
ssl_certificate /etc/letsencrypt/live/{{ env.Getenv "SHELLHUB_DOMAIN" }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ env.Getenv "SHELLHUB_DOMAIN" }}/privkey.pem;

Expand All @@ -15,7 +15,7 @@ server {

ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
{{ else -}}
listen 80{{ if bool (env.Getenv "SHELLHUB_PROXY") }} proxy_protocol{{ end }};
listen [::]:80{{ if bool (env.Getenv "SHELLHUB_PROXY") }} proxy_protocol{{ end }};
{{- end }}
{{ if bool (env.Getenv "SHELLHUB_PROXY") }}
set_real_ip_from ::/0;
Expand Down Expand Up @@ -390,7 +390,7 @@ server {

{{- $PUBLIC_URL_DOMAIN := or (env.Getenv "SHELLHUB_PUBLIC_URL_DOMAIN") (env.Getenv "SHELLHUB_DOMAIN") }}
server {
listen 80;
listen [::]:80;
server_name ~^(?<namespace>.+)\.(?<device>.+)\.{{ $PUBLIC_URL_DOMAIN }}$;
resolver 127.0.0.11 ipv6=off;

Expand All @@ -406,7 +406,7 @@ server {

{{ if and (bool (env.Getenv "SHELLHUB_AUTO_SSL")) (ne (env.Getenv "SHELLHUB_ENV") "development") -}}
server {
listen 80 default_server;
listen [::]:80 default_server;

return 301 https://$host$request_uri;
}
Expand Down