Skip to content

Commit

Permalink
adding nginx for sveltekit
Browse files Browse the repository at this point in the history
  • Loading branch information
charliewhu committed Sep 26, 2024
1 parent bc89e49 commit 4632522
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ services:
else
pnpm build && PORT=3001 node build --env-file=.env build;
fi"
networks:
- web

nginx:
build: ./nginx
depends_on:
- fastapi
- interex
expose:
- 80
environment:
- VIRTUAL_HOST=interex.charlieavery.site
- LETSENCRYPT_HOST=interex.charlieavery.site
Expand Down
4 changes: 4 additions & 0 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM nginx:1.23.3-alpine-slim

# replace nginx default with our new one
COPY ./default.conf /etc/nginx/conf.d/default.conf
19 changes: 19 additions & 0 deletions nginx/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
upstream interex {
server interex:3001; # name of container in compose
}

server {
listen 80;
server_name interex.charlieavery.site;

location / {
proxy_pass http://interex; # from above
proxy_set_header Host $host;
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;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}

0 comments on commit 4632522

Please sign in to comment.