-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
login will use reverse proxy nginx server, also some bug fixes comple…
…ted.
- Loading branch information
1 parent
0b2cdc5
commit 77b7c7d
Showing
7 changed files
with
201 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,5 +75,3 @@ EXPOSE 8080 | |
WORKDIR /app/in-sylva.user.login/ | ||
|
||
CMD [ "pm2-runtime", "npm","--", "start" ] | ||
|
||
# CMD npm run start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Base on offical NGINX Alpine image | ||
FROM nginx:alpine | ||
|
||
# Remove any existing config files | ||
RUN rm /etc/nginx/conf.d/* | ||
|
||
# Copy config files | ||
# *.conf files in conf.d/ dir get included in main config | ||
COPY ./nginx.conf /etc/nginx/conf.d/ | ||
|
||
# Expose the listening port | ||
EXPOSE 8081 | ||
|
||
# Launch NGINX | ||
CMD [ "nginx", "-g", "daemon off;" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
|
||
docker build --no-cache --tag in-sylva.login-server ./login/nginx/. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=STATIC:10m inactive=7d use_temp_path=off; | ||
|
||
upstream login_upstream { | ||
server login:8080; | ||
} | ||
|
||
upstream backend_gatekeeper { | ||
hash $remote_addr$remote_port consistent; | ||
|
||
server gatekeeper:4000; | ||
} | ||
|
||
upstream backend_keycloak { | ||
hash $remote_addr$remote_port consistent; | ||
|
||
server keycloak:8080; | ||
} | ||
|
||
server { | ||
listen 8081 default_server; | ||
|
||
server_name -; | ||
|
||
server_tokens off; | ||
|
||
gzip on; | ||
gzip_proxied any; | ||
gzip_comp_level 4; | ||
gzip_types text/css application/javascript image/svg+xml; | ||
|
||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection 'upgrade'; | ||
proxy_set_header Host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
|
||
add_header Access-Control-Allow-Origin '*' always; | ||
add_header Access-Control-Allow-Credentials 'true' always; | ||
add_header Access-Control-Allow-Methods 'GET, POST, PUT, PATCH, DELETE, OPTIONS' always; | ||
add_header Access-Control-Allow-Headers 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always; | ||
|
||
location /_next/static { | ||
proxy_cache STATIC; | ||
proxy_pass http://login_upstream; | ||
|
||
# For testing cache - remove before deploying to production | ||
add_header X-Cache-Status $upstream_cache_status; | ||
} | ||
|
||
location /static { | ||
proxy_cache STATIC; | ||
proxy_ignore_headers Cache-Control; | ||
proxy_cache_valid 60m; | ||
proxy_pass http://login_upstream; | ||
|
||
# For testing cache - remove before deploying to production | ||
add_header X-Cache-Status $upstream_cache_status; | ||
} | ||
|
||
location / { | ||
proxy_pass http://login_upstream; | ||
|
||
} | ||
|
||
location /gatekeeper/ { | ||
proxy_pass http://backend_gatekeeper/; | ||
|
||
} | ||
|
||
location /keycloak/ { | ||
proxy_pass http://backend_keycloak/keycloak/; | ||
} | ||
|
||
location /keycloak/auth/ { | ||
proxy_pass http://backend_keycloak/keycloak/auth/; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=STATIC:10m inactive=7d use_temp_path=off; | ||
|
||
upstream login_upstream { | ||
server login:8080; | ||
} | ||
|
||
upstream backend_gatekeeper { | ||
hash $remote_addr$remote_port consistent; | ||
|
||
server gatekeeper:4000; | ||
} | ||
|
||
upstream backend_keycloak { | ||
hash $remote_addr$remote_port consistent; | ||
|
||
server keycloak:8080; | ||
} | ||
|
||
server { | ||
listen 8081 default_server; | ||
|
||
server_name -; | ||
|
||
server_tokens off; | ||
|
||
gzip on; | ||
gzip_proxied any; | ||
gzip_comp_level 4; | ||
gzip_types text/css application/javascript image/svg+xml; | ||
|
||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection 'upgrade'; | ||
proxy_set_header Host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
|
||
add_header Access-Control-Allow-Origin '*' always; | ||
add_header Access-Control-Allow-Credentials 'true' always; | ||
add_header Access-Control-Allow-Methods 'GET, POST, PUT, PATCH, DELETE, OPTIONS' always; | ||
add_header Access-Control-Allow-Headers 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always; | ||
|
||
location /_next/static { | ||
proxy_cache STATIC; | ||
proxy_pass http://login_upstream; | ||
|
||
# For testing cache - remove before deploying to production | ||
add_header X-Cache-Status $upstream_cache_status; | ||
} | ||
|
||
location /static { | ||
proxy_cache STATIC; | ||
proxy_ignore_headers Cache-Control; | ||
proxy_cache_valid 60m; | ||
proxy_pass http://login_upstream; | ||
|
||
# For testing cache - remove before deploying to production | ||
add_header X-Cache-Status $upstream_cache_status; | ||
} | ||
|
||
location / { | ||
proxy_pass http://login_upstream; | ||
|
||
} | ||
|
||
location /gatekeeper/ { | ||
proxy_pass http://backend_gatekeeper/; | ||
|
||
} | ||
|
||
location /keycloak/ { | ||
proxy_pass http://backend_keycloak/keycloak/; | ||
} | ||
|
||
location /keycloak/auth/ { | ||
proxy_pass http://backend_keycloak/keycloak/auth/; | ||
} | ||
} |