Skip to content
Snippets Groups Projects
Commit dfab4ba7 authored by Sebastian Karius's avatar Sebastian Karius
Browse files

add nginx-cors

parent 8b790a21
No related branches found
No related tags found
No related merge requests found
...@@ -45,7 +45,7 @@ helm-package: ...@@ -45,7 +45,7 @@ helm-package:
- vdo-ninja-0.1.2.tgz - vdo-ninja-0.1.2.tgz
- ti-coder-0.2.6.tgz - ti-coder-0.2.6.tgz
- ti-lamp-0.1.2.tgz - ti-lamp-0.1.2.tgz
- nginx-cors-0.1.0.tgz - nginx-cors-0.1.1.tgz
expire_in: 1 hour expire_in: 1 hour
helm-publish: helm-publish:
...@@ -62,7 +62,7 @@ helm-publish: ...@@ -62,7 +62,7 @@ helm-publish:
- 'curl --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@vdo-ninja-0.1.2.tgz" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts"' - 'curl --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@vdo-ninja-0.1.2.tgz" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts"'
- 'curl --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@ti-coder-0.2.6.tgz" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts"' - 'curl --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@ti-coder-0.2.6.tgz" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts"'
- 'curl --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@ti-lamp-0.1.2.tgz" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts"' - 'curl --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@ti-lamp-0.1.2.tgz" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts"'
- 'curl --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@nginx-cors-0.1.0.tgz" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts"' - 'curl --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@nginx-cors-0.1.1.tgz" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts"'
stages: stages:
- build - build
......
...@@ -45,4 +45,4 @@ services: ...@@ -45,4 +45,4 @@ services:
dockerfile: Dockerfile dockerfile: Dockerfile
context: ./docker/nginx-cors context: ./docker/nginx-cors
cache_from: cache_from:
- ${CI_REGISTRY}/studio-r215/containerize/nginx-cors:1.0.0 - ${CI_REGISTRY}/studio-r215/containerize/nginx-cors:1.0.1
\ No newline at end of file \ No newline at end of file
FROM nginx:alpine FROM nginx:alpine
WORKDIR /etc/nginx
COPY nginx.conf.template nginx.conf.template COPY nginx.conf.template nginx.conf.template
CMD [ "/bin/sh" , "-c" , "envsubst < /nginx.conf.template > /etc/nginx/nginx.conf && exec nginx -g 'daemon off;'" ] CMD [ "/bin/sh" , "-c" , "envsubst < nginx.conf.template > /etc/nginx/conf.d/nginx.conf && exec nginx -g 'daemon off;'" ]
\ No newline at end of file \ No newline at end of file
...@@ -10,23 +10,22 @@ server { ...@@ -10,23 +10,22 @@ server {
server_name localhost; server_name localhost;
location / { location / {
#if ($request_method = OPTIONS) {
if ($request_method = 'OPTIONS') { # add_header 'Access-Control-Max-Age' 1728000;
add_header 'Access-Control-Max-Age' 1728000; # add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Origin' '*'; # add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,
add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent, # X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range'; # add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH'; # add_header 'Content-Type' 'application/json';
add_header 'Content-Type' 'application/json'; # add_header 'Content-Length' 0;
add_header 'Content-Length' 0; # return 204;
return 204; #}
}
add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent, add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,
X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range'; X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH'; add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
proxy_pass http://api/; proxy_pass http://api;
} }
} }
\ No newline at end of file
...@@ -15,10 +15,10 @@ type: application ...@@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes # This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version. # to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/) # Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0 version: 0.1.1
# This is the version number of the application being deployed. This version number should be # This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to # incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using. # follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes. # It is recommended to use it with quotes.
appVersion: "1.0.0" appVersion: "1.0.1"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment