sitmun / sitmun-application-stack

SITMUN Application Stack
European Union Public License 1.2
1 stars 1 forks source link

Broken Links in README.md for SITMUN Viewer and Administrative Applications #4

Closed fjlopez closed 2 months ago

fjlopez commented 3 months ago

Describe the bug The links in README.md for the SITMUN viewer application and the SITMUN administrative application are broken.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'http://localhost:9000/viewer'
  2. The browser redirects to 'http://localhost/viewer/'

Expected behavior The browser should be able to show the applications either at http://localhost:9000/viewer and at http://localhost:9000/viewer/ (same for the admin)

fjlopez commented 3 months ago

The solution involves modifying the Nginx configuration and the Docker Compose setup to correctly handle the exposed ports and ensure proper redirection.

  1. Create default.conf.template:

    • Replace default.conf with default.conf.template.
    • Include additional location blocks for /admin and /viewer with 301 redirects.
    • Use the environment variable EXPOSED_PORT in the template to dynamically include the exposed port in the Location headers.
  2. Update docker-compose.yml:

    • Add a command for the front service that dynamically creates the Nginx configuration template.
    • Inject the exposed port defined in the environment variable EXPOSED_PORT into the Nginx configuration using envsubst before starting Nginx.