From 644c4b1065e023b1e98d1878482cc22daea834d9 Mon Sep 17 00:00:00 2001 From: Paweł Dybiec Date: Wed, 3 Apr 2019 00:21:20 +0200 Subject: More apps --- composer/nginx/Dockerfile | 4 + composer/nginx/conf.d/dybiec.info.conf | 151 +++++++++++++++++++++++++++++++++ composer/nginx/docker-compose.yml | 11 +++ composer/nginx/nginx.conf | 31 +++++++ composer/nginx/static-html/index.html | 1 + 5 files changed, 198 insertions(+) create mode 100644 composer/nginx/Dockerfile create mode 100644 composer/nginx/conf.d/dybiec.info.conf create mode 100644 composer/nginx/docker-compose.yml create mode 100644 composer/nginx/nginx.conf create mode 100644 composer/nginx/static-html/index.html (limited to 'composer/nginx') diff --git a/composer/nginx/Dockerfile b/composer/nginx/Dockerfile new file mode 100644 index 0000000..fcca1df --- /dev/null +++ b/composer/nginx/Dockerfile @@ -0,0 +1,4 @@ +FROM nginx:1.15.8-alpine +COPY static-html /usr/share/nginx/html +COPY conf.d /etc/nginx/conf.d +COPY nginx.conf /etc/nginx/nginx.conf diff --git a/composer/nginx/conf.d/dybiec.info.conf b/composer/nginx/conf.d/dybiec.info.conf new file mode 100644 index 0000000..83e2cd6 --- /dev/null +++ b/composer/nginx/conf.d/dybiec.info.conf @@ -0,0 +1,151 @@ +server { + listen 80; + listen 443 ssl; + server_name .dybiec.info; + + ssl_certificate /etc/letsencrypt/live/dybiec.info/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dybiec.info/privkey.pem; + + location / { + root /usr/share/nginx/html; + index index.html; + } + +} +server { + listen 80; + listen 443 ssl; + server_name cnt.dybiec.info; + + ssl_certificate /etc/letsencrypt/live/dybiec.info/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dybiec.info/privkey.pem; + + location / { + proxy_pass http://localhost:5004; + } +} +server { + listen 80; + server_name git.dybiec.info; + return 301 https://$server_name$request_uri; +} +server { + listen 443 ssl; + server_name git.dybiec.info; + + ssl_certificate /etc/letsencrypt/live/dybiec.info/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dybiec.info/privkey.pem; + + location / { + proxy_pass http://localhost:5001; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_redirect off; + proxy_http_version 1.1; + } + gzip_proxied any; + gzip_types + text/css + text/javascript + text/xml + text/plain + application/javascript + application/x-javascript + application/json; + +} +server { + listen 80; + server_name grafana.dybiec.info; + return 301 https://$server_name$request_uri; +} +server { + listen 443 ssl; + server_name grafana.dybiec.info; + + ssl_certificate /etc/letsencrypt/live/dybiec.info/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dybiec.info/privkey.pem; + + location / { + proxy_pass http://localhost:5002; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_redirect off; + proxy_http_version 1.1; + } + gzip_proxied any; + gzip_types + text/css + text/javascript + text/xml + text/plain + application/javascript + application/x-javascript + application/json; + +} +server { + listen 80; + server_name prometheus.dybiec.info; + return 301 https://$server_name$request_uri; +} +server { + listen 443 ssl; + server_name prometheus.dybiec.info; + + ssl_certificate /etc/letsencrypt/live/dybiec.info/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dybiec.info/privkey.pem; + + location / { + proxy_pass http://localhost:5003; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_redirect off; + proxy_http_version 1.1; + } + gzip_proxied any; + gzip_types + text/css + text/javascript + text/xml + text/plain + application/javascript + application/x-javascript + application/json; + +} +server { + listen 80; + server_name octoprint.dybiec.info; + return 301 https://$server_name$request_uri; +} +server { + listen 443 ssl; + server_name octoprint.dybiec.info; + + ssl_certificate /etc/letsencrypt/live/dybiec.info/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dybiec.info/privkey.pem; + + location / { + proxy_pass http://192.168.255.6/; + proxy_redirect off; + proxy_http_version 1.1; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + + client_max_body_size 0; + } + gzip_proxied any; + gzip_types + text/css + text/javascript + text/xml + text/plain + application/javascript + application/x-javascript + application/json; + +} diff --git a/composer/nginx/docker-compose.yml b/composer/nginx/docker-compose.yml new file mode 100644 index 0000000..5e1b20c --- /dev/null +++ b/composer/nginx/docker-compose.yml @@ -0,0 +1,11 @@ +version: '3' +services: + main: + build: . + network_mode: host + volumes: + - "/etc/letsencrypt/live/dybiec.info:/etc/letsencrypt/live/dybiec.info:ro" + - "/etc/letsencrypt/archive/dybiec.info:/etc/letsencrypt/archive/dybiec.info:ro" + ports: + - "443:443" + - "80:80" diff --git a/composer/nginx/nginx.conf b/composer/nginx/nginx.conf new file mode 100644 index 0000000..aa6cbd7 --- /dev/null +++ b/composer/nginx/nginx.conf @@ -0,0 +1,31 @@ +user nginx; +worker_processes 1; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + tcp_nopush on; + + keepalive_timeout 65; + + gzip on; + + include /etc/nginx/conf.d/*.conf; +} diff --git a/composer/nginx/static-html/index.html b/composer/nginx/static-html/index.html new file mode 100644 index 0000000..ce01362 --- /dev/null +++ b/composer/nginx/static-html/index.html @@ -0,0 +1 @@ +hello -- cgit 1.4.1