Razique Mahroua
2019-11-29 345c6a9a8fb625add46ec24bb4f448d5a3941b37
Add a redirect rule to redirect all traffic from HTTP to HTTPs
Update the instructions on how to use the container with podman
2 files modified
35 ■■■■ changed files
todo-angular/README.md 31 ●●●● patch | view | raw | blame | history
todo-angular/nginx/nginx.conf 4 ●●●● patch | view | raw | blame | history
todo-angular/README.md
@@ -17,10 +17,31 @@
## How to run
### In HTTP mode
`podman run --userns keep-id  -v ./ssl/certs:/usr/local/etc/ssl/certs:Z --name todo -p 8080:8080 do280/todo-angular:latest`
```
podman run --userns keep-id \
  -v ./ssl/certs:/usr/local/etc/ssl/certs:Z \
  --name todo -p 8080:8080 \
  do280/todo-angular:latest`
```
### In HTTPs mode
`podman run --userns keep-id  -v ./ssl/certs:/usr/local/etc/ssl/certs:Z --name todo -p 8443:8443 do280/todo-angular:latest`
```
podman run --userns keep-id \
  -v ./ssl/certs:/usr/local/etc/ssl/certs:Z \
  --name todo -p 8443:8443 \
  do280/todo-angular:latest`
```
### In HTTP & HTTPS mode
Notice the port range:
```
podman run --userns keep-id \
  -v ./ssl/certs:/usr/local/etc/ssl/certs:Z \
  --name test \
  -p 8080-8443:8080-8443 \
  do280/todo-angular:latest
```
### Disable HTTPs support
If you need to disable HTTPs support, run the following steps:
@@ -30,9 +51,11 @@
  # 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 36
  2. In `nginx/nginx.conf`comment line 38 & 66:
  ```
  # include /etc/nginx/conf.d/*.conf;
  # include /etc/nginx/conf.d/*.conf;
  ...
  # error_page 497 https://$host:8443/$request_uri;
  ```
  3. Rebuild the image:
  ```
todo-angular/nginx/nginx.conf
@@ -33,6 +33,8 @@
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/default.d/*.conf;
    # Comment the following to disable the SSL configuration
    include /etc/nginx/conf.d/*.conf;
    perl_set $backend 'sub { return $ENV{"BACKEND_HOST"}; }';
@@ -60,6 +62,8 @@
        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;
    }
}