Added nginx configurations

Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
James Ketr 2023-01-15 17:22:01 -08:00
parent 726246778a
commit 7c7bf51415
5 changed files with 6 additions and 3 deletions

View File

@ -62,6 +62,7 @@ COPY /ketrface /website/ketrface
SHELL [ "/bin/bash", "-c" ]
ARG DEVELOPMENT=
RUN cp /website/server/nginx.conf /etc/nginx/sites-enabled/default
# If not DEVELOPMENT mode, copy production config, else development
RUN \
@ -83,6 +84,7 @@ RUN \
fi
COPY /scripts /opt/scripts
ENV PATH="${PATH}:/opt/scripts"
# In DEVELOPMENT mode, entrypoint launches 'npm start'
COPY /entrypoint.sh /

View File

@ -20,6 +20,7 @@ services:
- ${PORT}:80 # nginx -> server/app.js express app
- 127.0.0.1:14200:4200 # shellinabox
volumes:
- /etc/nginx/ssl:/etc/nginx/ssl:ro # Use host web keys
- ${PICTURES}:/pictures
- ${PWD}/db:/website/db
- ${PWD}/config/local.json:/website/config/local.json

View File

@ -1,5 +1,5 @@
# DEVELOPMENT -- use npm development server on port 3000 (entrypoint.sh)
location / {
location /identities {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

View File

@ -44,7 +44,7 @@ server {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass https://localhost:8123/;
proxy_pass http://localhost:8123/; # server/app.js - no HTTPS
}
location ~ /(db|conf) {

View File

@ -1,5 +1,5 @@
# PRODUCTION -- pre-built source
location / {
location /identities {
try_files $uri $uri/ =404;
alias /website/client/build/;
index index.html;