Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle HTTPS and Install certificate #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
certs/ssl/bundle.crt
certs/ssl/private.key
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
FROM nginx
COPY nginx.conf /etc/nginx/nginx.conf
COPY certs/ssl/bundle.crt /etc/nginx/certs/ssl/bundle.crt
COPY certs/ssl/private.key /etc/nginx/certs/ssl/private.key
Empty file added certs/ssl/tempate.private.key
Empty file.
Empty file added certs/ssl/template.bundle.crt
Empty file.
13 changes: 11 additions & 2 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
events {}
http {
server {
listen 80 default backlog=16384;
listen [::]:80 default backlog=16384;
listen 80;
listen [::]:80;
listen 443 ssl default_server backlog=16384;
listen [::]:443 ssl default_server backlog=16384;

ssl_certificate certs/ssl/bundle.crt;
ssl_certificate_key certs/ssl/private.key;

if ($scheme = http) {
return 301 https://$server_name$request_uri;
}

location /lib.min.js {
proxy_set_header X-Real-IP $http_x_forwarded_for;
Expand Down