Skip to content

Commit

Permalink
mjpg proxy added
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkrulltott committed Sep 9, 2019
1 parent 1949184 commit 85a3cd5
Show file tree
Hide file tree
Showing 9 changed files with 511 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/node_modules
**/dist
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:10
COPY ./ /app
WORKDIR /app
RUN npm install && npm run build

FROM nginx
RUN mkdir /app
COPY --from=0 /app/dist /app
COPY nginx.conf /etc/nginx/nginx.conf
72 changes: 72 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
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;
keepalive_timeout 65;
server {
listen 8080;
server_name localhost;
location / {
root /app;
index index.html;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

server {

# Listen to HTTPS on 443 and allow HTTP/2
listen 443 ssl http2 default;

# Path to the chain and privkey (Let's Encrypt)
ssl_certificate /certs/fullchain.pem;
ssl_certificate_key /certs/privkey.pem;

# Improve HTTPS performance with session resumption
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;

# Enable server-side protection against BEAST attacks
ssl_protocols TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
ssl_prefer_server_ciphers on;

# Diffie-Hellman parameter for DHE ciphersuites
# $ openssl dhparam -out dhparam.pem 4096
ssl_dhparam /certs/dhparam.pem;

# Enable OCSP stapling (http://blog.mozilla.org/security/2013/07/29/ocsp-stapling-in-firefox)
# uses Google DNS servers
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate /certs/fullchain.pem;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;

# Logging in a container
access_log /dev/stdout;
error_log stderr error;
error_log /dev/stdout info;

root /application/public/;
index index.html index.htm;

charset utf-8;
}
}
1 change: 0 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>image-host</title>
</head>
<body>
Expand Down
Loading

0 comments on commit 85a3cd5

Please sign in to comment.