6 Commits

Author SHA1 Message Date
argoyle aa37fcd7a7 Merge branch 'cors-headers' into 'master'
fix: add CORS headers to PUT-responses as well

See merge request unboundsoftware/nginx-s3-upload!4
2021-04-29 16:08:19 +00:00
argoyle 4815389992 fix: add CORS headers to PUT-responses as well 2021-04-29 17:53:30 +02:00
argoyle 3e1afa4ce8 Merge branch 'alb-ingress' into 'master'
chore: change to ALB ingress

See merge request unboundsoftware/nginx-s3-upload!3
2021-04-17 21:14:19 +00:00
argoyle 6b77b89238 chore: change to ALB ingress 2021-04-17 23:04:02 +02:00
argoyle adfc842896 Merge branch 'buildtools-version' into 'master'
chore: use buildtools version from env

See merge request unboundsoftware/nginx-s3-upload!2
2021-04-06 11:55:52 +00:00
argoyle 071dc38cc0 chore: use buildtools version from env 2021-04-06 13:47:16 +02:00
3 changed files with 24 additions and 7 deletions
+2 -2
View File
@@ -5,12 +5,12 @@ stages:
variables:
DOCKER_HOST: tcp://docker:2375/
image: buildtool/build-tools:0.0.23
image: buildtool/build-tools:${BUILDTOOLS_VERSION}
build:
stage: build
services:
- docker:19.03-dind
- docker:dind
script:
- build
- push
+12 -5
View File
@@ -72,7 +72,7 @@ spec:
targetPort: 80
selector:
app: nginx-s3-upload
type: ClusterIP
type: NodePort
---
@@ -81,15 +81,22 @@ kind: Ingress
metadata:
name: nginx-s3-upload
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
kubernetes.io/ingress.class: "alb"
alb.ingress.kubernetes.io/group.name: "unbound"
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80},{"HTTPS": 443}]'
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: instance
alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
spec:
rules:
- host: 'upload.unbound.se'
http:
paths:
- path: /*
backend:
serviceName: ssl-redirect
servicePort: use-annotation
- backend:
serviceName: nginx-s3-upload
servicePort: 80
path: /
path: /*
+10
View File
@@ -91,6 +91,11 @@ http {
resolver 8.8.8.8 valid=300s;
resolver_timeout 10s;
add_header 'Access-Control-Expose-Headers' 'X-File-Url';
add_header 'Access-Control-Allow-Origin' "*" ;
add_header 'Access-Control-Allow-Credentials' 'true' ;
add_header 'Access-Control-Allow-Methods' 'GET, PUT, OPTIONS' ;
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With';
add_header 'Access-Control-Max-Age' 1728000;
proxy_pass $url;
}
@@ -153,6 +158,11 @@ http {
resolver 8.8.8.8 valid=300s;
resolver_timeout 10s;
add_header 'Access-Control-Expose-Headers' 'X-File-Url';
add_header 'Access-Control-Allow-Origin' "*" ;
add_header 'Access-Control-Allow-Credentials' 'true' ;
add_header 'Access-Control-Allow-Methods' 'GET, PUT, OPTIONS' ;
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With';
add_header 'Access-Control-Max-Age' 1728000;
proxy_pass $url;
}