parent
761e7f4e06
commit
7a2079e3ef
@ -0,0 +1,10 @@ |
||||
FROM nginx:alpine |
||||
|
||||
ENV HTTPS_UPSTREAM="proxy" |
||||
ENV SSTP_UPSTREAM="sstp" |
||||
ENV CA_CERT="ca.pem" |
||||
|
||||
COPY nginx.conf /etc/nginx/ |
||||
COPY stream.conf.template /etc/nginx/templates/ |
||||
|
||||
RUN rm -f /etc/nginx/conf.d/default.conf |
@ -0,0 +1,12 @@ |
||||
user nginx; |
||||
worker_processes auto; |
||||
|
||||
error_log /var/log/nginx/error.log notice; |
||||
pid /var/run/nginx.pid; |
||||
|
||||
|
||||
events { |
||||
worker_connections 1024; |
||||
} |
||||
|
||||
include /etc/nginx/conf.d/*.conf; |
@ -0,0 +1,37 @@ |
||||
error_log /dev/stderr; |
||||
|
||||
stream { |
||||
map $ssl_client_verify $name { |
||||
SUCCESS sstp; |
||||
default https; |
||||
} |
||||
|
||||
upstream https { |
||||
server ${HTTPS_UPSTREAM}:443; |
||||
} |
||||
|
||||
upstream sstp { |
||||
server ${SSTP_UPSTREAM}:443; |
||||
} |
||||
|
||||
server { |
||||
listen 443 ssl; |
||||
listen [::]:443 ssl; |
||||
|
||||
ssl_certificate /etc/nginx/certs/cert.pem; |
||||
ssl_certificate_key /etc/nginx/certs/privkey.pem; |
||||
|
||||
ssl_trusted_certificate /etc/nginx/certs/${CA_CERT}; |
||||
ssl_verify_client optional; |
||||
|
||||
proxy_half_close on; |
||||
|
||||
# Doesn't work without it |
||||
proxy_ssl on; |
||||
proxy_ssl_session_reuse off; |
||||
|
||||
proxy_pass $name; |
||||
ssl_preread on; |
||||
proxy_protocol on; |
||||
} |
||||
} |
@ -0,0 +1,7 @@ |
||||
server { |
||||
listen 443 ssl; |
||||
server_name _; |
||||
ssl_certificate /etc/nginx/certs/cert.pem; |
||||
ssl_certificate_key /etc/nginx/certs/privkey.pem; |
||||
return 404; |
||||
} |
@ -0,0 +1,3 @@ |
||||
FROM nginx:alpine |
||||
|
||||
COPY 00-default.conf /etc/nginx/conf.d/ |
Loading…
Reference in new issue