Skip to content

Commit

Permalink
Add ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
mricharleon committed Jun 20, 2017
1 parent 174024d commit 19724ea
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ ENV DB_PORT=5432
# Necesario para generar documentación en formato LatexPDF
#RUN apt-get install texlive-formats-extra && \
#apt-get install latexmk
RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-subj "/C=''/ST=''/L=''/O=''/CN=''" -keyout nginx.key -out nginx.crt

ADD requirements.txt /usr/src/app
RUN pip install -r requirements.txt
ADD userena /usr/src/app
Expand Down
2 changes: 1 addition & 1 deletion SIDGV/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
# django realtime
ISHOUT_CLIENT_ADDR = '127.0.0.1:5500' # modificar
ISHOUT_API_ADDR = 'node:6600'
ISHOUT_HTTPS = False
ISHOUT_HTTPS = True

CRON_CLASSES = [
"ganados.cron.CronJobProduccion",
Expand Down
4 changes: 2 additions & 2 deletions SIDGV/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<link rel="stylesheet" href="{{STATIC_URL}}css/normalize.css">
<link rel="stylesheet" href="{{STATIC_URL}}css/style.css">
<link rel="stylesheet" href="{{STATIC_URL}}css/landing_page.css">
<link href='http://fonts.googleapis.com/css?family=Abel' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Abel' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'>

{% load drealtimetags %}
{% ishout_js %}
Expand Down
12 changes: 12 additions & 0 deletions config/nginx/hg-default
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ upstream app_upstream {

server {
listen 80;
rewrite ^ https://$http_host$request_uri? permanent; # force redirect http to https
server_tokens off;
}

server {
listen 443;
ssl on;
ssl_certificate /usr/src/app/nginx.crt; # path to your cacert.pem
ssl_certificate_key /usr/src/app/nginx.key; # path to your privkey.pem
server_tokens off;
fastcgi_param HTTPS on;
fastcgi_param HTTP_SCHEME https;

charset utf-8;
client_max_body_size 200M;
Expand Down
2 changes: 2 additions & 0 deletions config/node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ RUN mkdir /src
WORKDIR /src
RUN npm install ishout.js
COPY . /src
RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-subj "/C=''/ST=''/L=''/O=''/CN=''" -keyout key.key -out crt.crt
CMD ["node", "node_modules/ishout.js/server.js", "--config=ishout.config.json"]
4 changes: 3 additions & 1 deletion config/node/ishout.config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"redisHost":"redis",
"apiHost":"node"
"apiHost":"node",
"sslKey":"/src/key.key",
"sslCert":"/src/crt.crt"
}
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
build: ./config/nginx
ports:
- "80:80"
- "443:443"
links:
- hatosganaderos
volumes:
Expand Down

0 comments on commit 19724ea

Please sign in to comment.