chore: nginx configuratie toegevoed
nginx geconfigureerd en via docker gekopiëerd, SSL ingesteld en volume voor gemaakt in docker compose zodat de certificates op de server gevonden worden door docker
This commit is contained in:
parent
8890542f5e
commit
6918f45e34
3 changed files with 55 additions and 0 deletions
|
@ -7,6 +7,8 @@ services:
|
|||
ports:
|
||||
- '443:443'
|
||||
- '80:80'
|
||||
volumes:
|
||||
- ssl:/etc/letsencrypt/live/sel2-1.ugent.be/
|
||||
api:
|
||||
build:
|
||||
dockerfile: ./backend.Dockerfile
|
||||
|
@ -46,3 +48,4 @@ volumes:
|
|||
dwengo_postgres_data:
|
||||
dwengo_loki_data:
|
||||
dwengo_grafana_data:
|
||||
ssl:
|
||||
|
|
|
@ -10,6 +10,8 @@ RUN npm run build
|
|||
|
||||
# production stage
|
||||
FROM nginx:stable AS production-stage
|
||||
COPY ./nginx/nginx.conf /etc/nginx/
|
||||
COPY --from=build-stage /app/frontend/dist /usr/share/nginx/html
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
50
nginx/nginx.conf
Normal file
50
nginx/nginx.conf
Normal file
|
@ -0,0 +1,50 @@
|
|||
worker_processes auto;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
server {
|
||||
server_name sel2-1.ugent.be;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://127.0.0.1:2002/;
|
||||
}
|
||||
|
||||
listen 80;
|
||||
listen 443 default_server ssl; # managed by Certbot
|
||||
ssl_certificate /etc/letsencrypt/live/sel2-1.ugent.be/fullchain.pem; # managed by Certbot
|
||||
ssl_certificate_key /etc/letsencrypt/live/sel2-1.ugent.be/privkey.pem; # managed by Certbot
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
||||
|
||||
}
|
||||
|
||||
server {
|
||||
listen 2002;
|
||||
server_name dwengo-api;
|
||||
|
||||
location / {
|
||||
root /usr/share/api;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# server {
|
||||
# if ($host = sel2-1.ugent.be) {
|
||||
# return 301 https://$host$request_uri;
|
||||
# } # managed by Certbot
|
||||
#
|
||||
#
|
||||
# listen 80;
|
||||
# server_name sel2-1.ugent.be;
|
||||
# return 404; # managed by Certbot
|
||||
#
|
||||
# }
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue