Skip to content

Commit

Permalink
local nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
Eliran Turgeman authored and Eliran Turgeman committed Dec 19, 2024
1 parent b6ab4e1 commit 4574955
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,12 @@ ngrok2/
grafana/

prometheus/
/nginx/nginx.conf
swagger.json

.idea/

Push-CollectoImage.ps1

CustomEmailTemplates/
CustomEmailTemplates/

nginx/certs/
15 changes: 14 additions & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ services:
build:
context: .
dockerfile: EmailCollector.Api/Dockerfile
container_name: collecto
ports:
- "5001:8080"
volumes:
Expand Down Expand Up @@ -70,6 +69,20 @@ services:
networks:
- email-collector-net

nginx:
image: nginx:latest
container_name: reverse-proxy
ports:
- "443:443"
- "80:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/certs:/etc/nginx/certs:ro
depends_on:
- api
networks:
- email-collector-net

networks:
email-collector-net:
driver: bridge
Expand Down
23 changes: 23 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
events { }

http {
server {
listen 443 ssl;
server_name localhost;

ssl_certificate /etc/nginx/certs/server.crt;
ssl_certificate_key /etc/nginx/certs/server.key;

location / {
proxy_pass http://api:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}

server {
listen 80;
server_name localhost;
return 301 https://$host$request_uri;
}
}

0 comments on commit 4574955

Please sign in to comment.