Senti
Senti
CC#
Created by Senti on 6/10/2024 in #help
Webapi with SSL in production, using docker
so these are the corresponding docker-compose services I guess :
backend-proxy:
container_name: backend-proxy
image: nginx:1.24-alpine-slim
ports:
- "81:80"
- "5000:443"
restart: always
volumes:
- ./backend-proxy-conf/reverse_proxy.conf:/etc/nginx/conf.d/default.conf:ro # set-up reverse proxy conf
- ./backend-proxy-logs:/var/log/nginx
- /etc/ssl:/etc/ssl:ro # volume on certificates

backend:
container_name: myWebApi
image: mydockerhub/myWebApi:1.0
expose:
- "5001"
depends_on:
- database
restart: always
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ASPNETCORE_URLS=http://+5001
- DB_CONNECTION_STRING=server=database;port=3306;user id=root;password=root;database=some_db
backend-proxy:
container_name: backend-proxy
image: nginx:1.24-alpine-slim
ports:
- "81:80"
- "5000:443"
restart: always
volumes:
- ./backend-proxy-conf/reverse_proxy.conf:/etc/nginx/conf.d/default.conf:ro # set-up reverse proxy conf
- ./backend-proxy-logs:/var/log/nginx
- /etc/ssl:/etc/ssl:ro # volume on certificates

backend:
container_name: myWebApi
image: mydockerhub/myWebApi:1.0
expose:
- "5001"
depends_on:
- database
restart: always
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ASPNETCORE_URLS=http://+5001
- DB_CONNECTION_STRING=server=database;port=3306;user id=root;password=root;database=some_db
And the reverse_proxy conf, maybe :
server {
listen 80;
listen 443;
location / {
proxy_pass http://myWebApi:5001/; # I don't know if I can use container name here directly
}
}
server {
listen 80;
listen 443;
location / {
proxy_pass http://myWebApi:5001/; # I don't know if I can use container name here directly
}
}
`
6 replies
CC#
Created by πŠπ«ΓΈπ‘ΓΈπ— on 6/10/2024 in #help
βœ… From App C# Error
I read some stuff on the web about bad namespaces concerning "Properties" issues https://stackoverflow.com/questions/9665335/properties-does-not-exist-in-the-current-context
30 replies
CC#
Created by Senti on 6/10/2024 in #help
Webapi with SSL in production, using docker
I'm not sure I got your question : yes my VPS is running, and available through IP or domain name. What you call "load balancer" is probably what I called "reverse_proxy"
6 replies