Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
Charts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
魏国强
Charts
Commits
3e731e37
Commit
3e731e37
authored
Oct 11, 2021
by
sonicaj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add nginx configuration for nextcloud
parent
12efaafa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
136 additions
and
0 deletions
+136
-0
test/nextcloud/1.3.6/ix_values.yaml
test/nextcloud/1.3.6/ix_values.yaml
+5
-0
test/nextcloud/1.3.6/templates/_nginx.tpl
test/nextcloud/1.3.6/templates/_nginx.tpl
+79
-0
test/nextcloud/1.3.6/templates/nginx-configmap.yaml
test/nextcloud/1.3.6/templates/nginx-configmap.yaml
+52
-0
No files found.
test/nextcloud/1.3.6/ix_values.yaml
View file @
3e731e37
...
@@ -2,3 +2,8 @@ image:
...
@@ -2,3 +2,8 @@ image:
pullPolicy
:
IfNotPresent
pullPolicy
:
IfNotPresent
repository
:
nextcloud
repository
:
nextcloud
tag
:
'
22.2'
tag
:
'
22.2'
nginx
:
image
:
repository
:
nginx
tag
:
1.21.3
pullPolicy
:
IfNotPresent
test/nextcloud/1.3.6/templates/_nginx.tpl
0 → 100644
View file @
3e731e37
{{
/*
Retrieve
true
/
false
if
certificate
is
configured
*/
}}
{{- define "nginx.certAvailable" -}}
{{- if .Values.certificate -}}
{{- $values := (. | mustDeepCopy) -}}
{{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.Values.certificate) -}}
{{- template "common.resources.cert_present" $values -}}
{{- else -}}
{{- false -}}
{{- end -}}
{{- end -}}
{
{
/*
Retrieve
public
key
of
certificate
*/
}
}
{{- define "nginx.cert.publicKey" -}}
{{- $values := (. | mustDeepCopy) -}}
{{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.Values.certificate "publicKey" true) -}}
{{ include "common.resources.cert" $values }}
{{- end -}}
{
{
/*
Retrieve
private
key
of
certificate
*/
}
}
{{- define "nginx.cert.privateKey" -}}
{{- $values := (. | mustDeepCopy) -}}
{{- $_ := set $values "commonCertOptions" (dict "certKeyName" $values.Values.certificate) -}}
{{ include "common.resources.cert" $values }}
{{- end -}}
{
{
/*
Retrieve
configured
protocol
scheme
for
nextcloud
*/
}
}
{{- define "nginx.scheme" -}}
{{- if eq (include "nginx.certAvailable" .) "true" -}}
{{- print "https" -}}
{{- else -}}
{{- print "http" -}}
{{- end -}}
{{- end -}}
{
{
/*
Retrieve
nginx
certificate
secret
name
*/
}
}
{{- define "nginx.secretName" -}}
{{- print "nginx-secret" -}}
{{- end -}}
{
{
/*
Formats
volumeMount
for
tls
keys
and
trusted
certs
*/
}
}
{{- define "nginx.tlsKeysVolumeMount" -}}
{{- if eq (include "nginx.certAvailable" .) "true" -}}
- name: cert-secret-volume
mountPath: "/etc/nginx"
{{- end -}}
{{- end -}}
{
{
/*
Formats
volume
for
tls
keys
and
trusted
certs
*/
}
}
{{- define "nginx.tlsKeysVolume" -}}
{{- if eq (include "nginx.certAvailable" .) "true" -}}
- name: cert-secret-volume
secret:
secretName: {{ include "nginx.secretName" . }}
items:
- key: certPublicKey
path: public.crt
- key: certPrivateKey
path: private.key
{{- end -}}
{{- end -}}
test/nextcloud/1.3.6/templates/nginx-configmap.yaml
0 → 100644
View file @
3e731e37
apiVersion
:
v1
kind
:
ConfigMap
metadata
:
name
:
"
nginx-configuration"
data
:
config
:
|-
http {
# redirects all http requests to https requests
server {
listen 80 default_server;
listen [::]:80 default_server;
return 301 https://$host$request_uri;
}
server {
server_name localhost;
listen 443 ssl http2;
listen [::]:433 ssl http2;
ssl_certificate /etc/nginx/public.crt
ssl_certificate_key /etc/nginx/private.key
ssl_session_timeout 120m;
ssl_session_cache shared:ssl:16m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA:EDH+aRSA:EECDH:!RC4:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS;
add_header Strict-Transport-Security max-age=31536000;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1";
# maximum 3GB Upload File; change to fit your needs
client_max_body_size 3G;
location / {
# We clear this as we will be adding it in our reverse proxy
more_clear_headers 'Strict-Transport-Security';
proxy_pass http://localhost:80;
# set proper x-forwarded-headers
# proxy_set_header 'X-Forwarded-Host' nextcloud.domain.tld;
# proxy_set_header 'X-Forwarded-Proto' https;
# -For and -IP:
# see https://stackoverflow.com/questions/19366090/what-is-the-difference-between-x-forwarded-for-and-x-forwarded-ip
proxy_set_header 'X-Forwarded-For' $remote_addr;
proxy_set_header 'X-Forwarded-IP' $remote_addr;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment