Razique Mahroua
2019-11-30 429728d0a08fd274ab59b85de60b938efa4d2012
Add redirection from HTTP to HTTPS
Update Dockerfile so the container can run in OpenShift
3 files modified
14 ■■■■■ changed files
todo-angular/Dockerfile 4 ●●●● patch | view | raw | blame | history
todo-angular/README.md 5 ●●●●● patch | view | raw | blame | history
todo-angular/nginx/nginx.conf 5 ●●●●● patch | view | raw | blame | history
todo-angular/Dockerfile
@@ -18,13 +18,13 @@
## End of SSL
RUN touch /run/nginx.pid \
  && chgrp -R nginx /var/log/nginx /run/nginx.pid \
  && chgrp -R 0 /var/log/nginx /run/nginx.pid \
  && chmod -R g+rwx /var/log/nginx /run/nginx.pid
COPY src/ /usr/share/nginx/html
EXPOSE 8080 8443
USER nginx
USER 1001
CMD nginx -g "daemon off;"
todo-angular/README.md
@@ -51,11 +51,12 @@
  # COPY nginx/dhparam.pem /etc/ssl/conf/dhparam.pem
  # COPY nginx/conf.d/ssl.conf /etc/nginx/conf.d/ssl.conf
  ```
  2. In `nginx/nginx.conf`comment line 38 & 66:
  2. In `nginx/nginx.conf`comment line 38 & 66-67:
  ```
  # include /etc/nginx/conf.d/*.conf;
  ...
  # error_page 497 https://$host:8443/$request_uri;
  # error_page 497 https://$host:8443$request_uri;
  # return 301 https://$host:8443$request_uri;
  ```
  3. Rebuild the image:
  ```
todo-angular/nginx/nginx.conf
@@ -62,8 +62,9 @@
        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
        # Comment the following to disable SSL support
        error_page 497 https://$host:8443/$request_uri;
        # Comment the following lines to disable SSL support
        error_page 497 https://$host:8443$request_uri;
        return 301 https://$host:8443$request_uri;
    }
}