diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 98434c9c29f1905c6fb7691d266e7e4b650ba813..188436ffe443a21ba74e04d2f662791b8b55d814 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,7 +45,7 @@ helm-package: - vdo-ninja-0.1.2.tgz - ti-coder-0.2.6.tgz - ti-lamp-0.1.2.tgz - - nginx-cors-0.1.0.tgz + - nginx-cors-0.1.1.tgz expire_in: 1 hour 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=@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=@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: - build diff --git a/docker-compose.yml b/docker-compose.yml index 84b0244801081caf4c68d641c4faf4a3717f69d9..e0a077d206c5569b70ebbcf5bb18b07152840753 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -45,4 +45,4 @@ services: dockerfile: Dockerfile context: ./docker/nginx-cors cache_from: - - ${CI_REGISTRY}/studio-r215/containerize/nginx-cors:1.0.0 \ No newline at end of file + - ${CI_REGISTRY}/studio-r215/containerize/nginx-cors:1.0.1 \ No newline at end of file diff --git a/docker/nginx-cors/Dockerfile b/docker/nginx-cors/Dockerfile index 7b8954a7d5a3f3bd0e90f7468870a1d2f1256949..d24c8afb9f840613a1a62a1261fd2215d237862e 100644 --- a/docker/nginx-cors/Dockerfile +++ b/docker/nginx-cors/Dockerfile @@ -1,4 +1,5 @@ FROM nginx:alpine +WORKDIR /etc/nginx COPY nginx.conf.template nginx.conf.template -CMD [ "/bin/sh" , "-c" , "envsubst < /nginx.conf.template > /etc/nginx/nginx.conf && exec nginx -g 'daemon off;'" ] \ No newline at end of file +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 diff --git a/docker/nginx-cors/nginx.conf.template b/docker/nginx-cors/nginx.conf.template index e69340db5bb4c765ccc4b50c610b84dd580ff17b..9bc5913fb290ade557667647de074cf127ab5cd4 100644 --- a/docker/nginx-cors/nginx.conf.template +++ b/docker/nginx-cors/nginx.conf.template @@ -10,23 +10,22 @@ server { server_name localhost; location / { - - if ($request_method = 'OPTIONS') { - add_header 'Access-Control-Max-Age' 1728000; - add_header 'Access-Control-Allow-Origin' '*'; - 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'; - add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH'; - add_header 'Content-Type' 'application/json'; - add_header 'Content-Length' 0; - return 204; - } + #if ($request_method = OPTIONS) { + # add_header 'Access-Control-Max-Age' 1728000; + # add_header 'Access-Control-Allow-Origin' '*'; + # 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'; + # add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH'; + # add_header 'Content-Type' 'application/json'; + # add_header 'Content-Length' 0; + # return 204; + #} add_header 'Access-Control-Allow-Origin' '*'; 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'; 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 diff --git a/helm/nginx-cors/Chart.yaml b/helm/nginx-cors/Chart.yaml index b3bf7cc2daf711d5ca47d1304d48b5fafb62365c..9f144f59c6c354bfb383900f259044934715e99e 100644 --- a/helm/nginx-cors/Chart.yaml +++ b/helm/nginx-cors/Chart.yaml @@ -15,10 +15,10 @@ type: application # 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. # 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 # 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. # It is recommended to use it with quotes. -appVersion: "1.0.0" +appVersion: "1.0.1"