Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

Commit

Permalink
Fix ngnix config
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej committed Mar 28, 2021
1 parent 94820c4 commit 21d4f88
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 29 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ RUN yarn build

# production environment
FROM nginx:stable-alpine
#COPY --from=build /app/build /usr/share/nginx/html
COPY --from=build /app/build /usr/share/nginx/html/keycloakify-demo-app
COPY --from=build /app/build /usr/share/nginx/html
COPY --from=build /app/nginx.conf /etc/nginx/conf.d/default.conf
CMD nginx -g 'daemon off;'
3 changes: 1 addition & 2 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ COPY nginx.conf .

# production environment (copy pasted from ./Dockerfile)
FROM nginx:stable-alpine
#COPY --from=build /app/build /usr/share/nginx/html
COPY --from=build /app/build /usr/share/nginx/html/keycloakify-demo-app
COPY --from=build /app/build /usr/share/nginx/html
COPY --from=build /app/nginx.conf /etc/nginx/conf.d/default.conf
CMD nginx -g 'daemon off;'
48 changes: 24 additions & 24 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
# NOTE: This file will only work with an app hosted at root
# it is not the case here ("homename": "https://.../keyclaokify-demo-app")
server {
listen 80;

location /keycloakify-demo-app {
root /usr/share/nginx/html;
index index.html;

root /usr/share/nginx/html;

}
try_files $uri $uri/ /index.html;

# Any route containing a file extension (e.g. /devicesfile.js)
location ~ ^.+\..+$ {
try_files $uri =404;

#location ~* \.(?:manifest|appcache|html?|xml|json)$ {
# expires -1;
#}
location ~* \.(?:html|json|txt)$ {
expires -1;
}

#location ~* \.(?:css|js|eot|ttf|woff|woff2|svg)$ {
# try_files $uri =404;
# expires 1y;
# access_log off;
# add_header Cache-Control "public";
#}
# CRA generates filenames with hashes so we can
# tell the browser to keep in cache the resources.
location ~* \.(?:css|js|woff2?|eot|ttf|xml)$ {
expires 1y;
access_log off;
add_header Cache-Control "public";

#location ~* \.(eot|ttf|woff|woff2|svg)$ {
# add_header Access-Control-Allow-Origin *;
#}
# Allow font to be downloaded from pages
# served by Keycloak
location ~* \.(?:woff2?|eot|ttf|xml)$ {
add_header Access-Control-Allow-Origin *;
}

## Any route containing a file extension (e.g. /devicesfile.js)
#location ~ ^.+\..+$ {
# try_files $uri =404;
#}
}

## Any route that doesn't have a file extension (e.g. /devices)
#location / {
# try_files $uri $uri/ /index.html;
#}
}

}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"homepage": "https://garronej.github.io/keycloakify-demo-app",
"homepage": "https://garronej.github.io/keycloakify-demo-app/",
"name": "keycloakify-demo-app",
"version": "0.2.9",
"description": "A demo project for keycloakify",
Expand Down

0 comments on commit 21d4f88

Please sign in to comment.