commit dda5dcf833f4961c4f3478c712837dfb3bca63f2 Author: vanten-s Date: Sun Aug 20 12:34:42 2023 +0200 Initial commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..480507d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM nginx:latest + +# Copy config +COPY nginx.conf nginx.conf + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..17e8b94 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,5 @@ +services: + nginx: + build: . + network_mode: "host" + diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..88bbacb --- /dev/null +++ b/nginx.conf @@ -0,0 +1,83 @@ +events {} + +http { +server { + listen 80; + return 301 https://$host$request_uri; +} + +server { + server_name nextcloud.vanten-s.com; + + location / { + proxy_pass http://127.0.0.1:11000$request_uri; + + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Port $server_port; + proxy_set_header X-Forwarded-Scheme $scheme; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Accept-Encoding ""; + proxy_set_header Host $host; + + client_body_buffer_size 512k; + proxy_read_timeout 86400s; + client_max_body_size 0; + } + + listen 443 ssl; # managed by Certbot + ssl_certificate /etc/letsencrypt/live/vanten-s.com/fullchain.pem; # managed by Certbot + ssl_certificate_key /etc/letsencrypt/live/vanten-s.com/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 { + server_name vnc.vanten-s.com; + location / { + proxy_pass http://localhost:8089; + } + + listen 443 ssl; # managed by Certbot + ssl_certificate /etc/letsencrypt/live/vanten-s.com/fullchain.pem; # managed by Certbot + ssl_certificate_key /etc/letsencrypt/live/vanten-s.com/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 { + server_name forgejo.vanten-s.com; + client_max_body_size 0; + location / { + 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_pass http://172.21.0.3:3000/; + } + + listen 443 ssl; # managed by Certbot + ssl_certificate /etc/letsencrypt/live/vanten-s.com/fullchain.pem; # managed by Certbot + ssl_certificate_key /etc/letsencrypt/live/vanten-s.com/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 { + server_name vanten-s.com www.vanten-s.com; + location / { + proxy_pass http://172.20.0.2:3000/; + } + + listen 443 ssl; # managed by Certbot + ssl_certificate /etc/letsencrypt/live/vanten-s.com/fullchain.pem; # managed by Certbot + ssl_certificate_key /etc/letsencrypt/live/vanten-s.com/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 + + +} +}