Commit 28dc4c0f authored by Martin Lowe's avatar Martin Lowe 🇨🇦
Browse files

Merge branch 'cguindon/master/cors' into 'master'

share organization api with external sites

See merge request !500
parents 8c7a0613 97675dc2
Pipeline #2020 passed with stage
in 0 seconds
# don't cache it
proxy_no_cache 1;
# even if cached, don't try to use it
proxy_cache_bypass 1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# kill cache
add_header Last-Modified $date_gmt;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
if_modified_since off;
expires off;
etag off;
\ No newline at end of file
......@@ -5,7 +5,7 @@ server {
client_max_body_size 16m;
client_body_buffer_size 128k;
# proxy buffering configuration
# https://stackoverflow.com/a/27551259/8538422
proxy_buffer_size 128k;
......@@ -13,23 +13,19 @@ server {
proxy_busy_buffers_size 256k;
location /api {
# don't cache it
proxy_no_cache 1;
# even if cached, don't try to use it
proxy_cache_bypass 1;
include conf.d/api-proxy.conf;
proxy_pass http://localhost:8090/api; # note the trailing slash here, it matters!
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# kill cache
add_header Last-Modified $date_gmt;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
if_modified_since off;
expires off;
etag off;
location ~* ^\/api\/organizations(\/\d+\/?|\/)?$ {
if ($request_method = GET) {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Expose-Headers Etag,Link,Content-Type;
}
rewrite ^\/api\/organizations(/\d+)?$ /api/organizations$1 break;
include conf.d/api-proxy.conf;
proxy_pass http://localhost:8090;
}
}
location /organization/images {
......
......@@ -3,5 +3,5 @@ ARG NGINX_IMAGE_TAG=stable-alpine-for-hugo
FROM eclipsefdn/nginx:${NGINX_IMAGE_TAG}
COPY config/nginx/nginx.conf /etc/nginx/conf.d/default.conf
ADD config/nginx /etc/nginx/conf.d
COPY src/main/www/build /usr/share/nginx/html/
\ No newline at end of file
quarkus.log.level=INFO
quarkus.http.port=8090
quarkus.http.cors=false
eclipse.cors.enabled=false
quarkus.cache.caffeine."default".expire-after-write=30M
quarkus.cache.caffeine."ttl".expire-after-write=${quarkus.cache.caffeine."default".expire-after-write}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment