From e47e1c0d820ebace70eefb5f624770d0d9eb99d9 Mon Sep 17 00:00:00 2001 From: jfederico Date: Mon, 3 Feb 2020 14:31:56 -0500 Subject: First commit --- nginx/default/html/index.html | 25 +++++++++++++++++++++++++ nginx/nginx.conf | 37 +++++++++++++++++++++++++++++++++++++ nginx/sites.template | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 nginx/default/html/index.html create mode 100644 nginx/nginx.conf create mode 100644 nginx/sites.template (limited to 'nginx') diff --git a/nginx/default/html/index.html b/nginx/default/html/index.html new file mode 100644 index 0000000..2ca3b95 --- /dev/null +++ b/nginx/default/html/index.html @@ -0,0 +1,25 @@ + + + +Welcome to nginx! + + + +

Welcome to nginx!

+

If you see this page, the nginx web server is successfully installed and +working. Further configuration is required.

+ +

For online documentation and support please refer to +nginx.org.
+Commercial support is available at +nginx.com.

+ +

Thank you for using nginx.

+ + diff --git a/nginx/nginx.conf b/nginx/nginx.conf new file mode 100644 index 0000000..981c619 --- /dev/null +++ b/nginx/nginx.conf @@ -0,0 +1,37 @@ +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; + + ## + # Virtual Host Configs + ## + + include /etc/nginx/sites-enabled/*; +} diff --git a/nginx/sites.template b/nginx/sites.template new file mode 100644 index 0000000..4252f81 --- /dev/null +++ b/nginx/sites.template @@ -0,0 +1,37 @@ +#### For + +upstream docker-scalelite { + server scalelite:3000; +} + +server { + server_name sl.$NGINX_DOMAIN; + + listen 80; + listen [::]:80; + listen 443 ssl; + listen [::]:443; + + ssl_certificate /etc/letsencrypt/live/sl.$NGINX_DOMAIN/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/sl.$NGINX_DOMAIN/privkey.pem; + + location / { + proxy_pass http://docker-scalelite; + proxy_read_timeout 60s; + proxy_redirect off; + + proxy_set_header Host $http_host; + + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Cookie "$http_cookie; ip=$remote_addr"; + + proxy_set_header X-Forwarded-Proto $scheme; + + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + rewrite ~/(.*)$ /$1 break; + } +} -- cgit v1.2.3