diff --git a/.github/workflows/examples_test.yml b/.github/workflows/examples_test.yml index cedd4ea7d..37d30a055 100644 --- a/.github/workflows/examples_test.yml +++ b/.github/workflows/examples_test.yml @@ -114,9 +114,9 @@ jobs: - name: Stop BaSyx Minimal Example run: docker compose -f examples/BaSyxMinimal/docker-compose.yml down - test-basyx-nginx: + test-basyx-reverse-proxy: runs-on: ubuntu-latest - name: Test BaSyx NGINX Example + name: Test BaSyx Reverse Proxy Example steps: - uses: actions/checkout@v5 @@ -127,11 +127,11 @@ jobs: distribution: 'adopt' cache: maven - - name: Start BaSyx NGINX Example - run: docker compose -f examples/BaSyxNGINX/docker-compose.yml up -d + - name: Start BaSyx Reverse Proxy Example + run: docker compose -f examples/BaSyxReverseProxy/docker-compose.yml up -d - - name: Stop BaSyx NGINX Example - run: docker compose -f examples/BaSyxNGINX/docker-compose.yml down + - name: Stop BaSyx Reverse Proxy Example + run: docker compose -f examples/BaSyxReverseProxy/docker-compose.yml down test-basyx-operation-delegation: runs-on: ubuntu-latest diff --git a/examples/BaSyxNGINX/nginx/nginx.conf b/examples/BaSyxNGINX/nginx/nginx.conf deleted file mode 100644 index 7fa500bc0..000000000 --- a/examples/BaSyxNGINX/nginx/nginx.conf +++ /dev/null @@ -1,52 +0,0 @@ -events {} - -http { - server { - listen 80; - - # Configuration for the AAS Environment - location /aas-env/ { - proxy_pass http://aas-env:8081/aas-env/; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } - - # Configuration for the AAS Registry - location /aas-registry/ { - proxy_pass http://aas-registry:8080/aas-registry/; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } - - # Configuration for the Submodel Registry - location /sm-registry/ { - proxy_pass http://sm-registry:8080/sm-registry/; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } - - # Configuration for the AAS Discovery Service - location /aas-discovery/ { - proxy_pass http://aas-discovery:8081/aas-discovery/; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } - - # Configuration for the AAS Web UI - location /aas-ui/ { - proxy_pass http://aas-ui:3000/aas-ui/; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } - } -} \ No newline at end of file diff --git a/examples/BaSyxNGINX/README.md b/examples/BaSyxReverseProxy/README.md similarity index 100% rename from examples/BaSyxNGINX/README.md rename to examples/BaSyxReverseProxy/README.md diff --git a/examples/BaSyxNGINX/aas/ExampleV3.aasx b/examples/BaSyxReverseProxy/aas/ExampleV3.aasx similarity index 100% rename from examples/BaSyxNGINX/aas/ExampleV3.aasx rename to examples/BaSyxReverseProxy/aas/ExampleV3.aasx diff --git a/examples/BaSyxNGINX/aas/test_demo_full_example.xml b/examples/BaSyxReverseProxy/aas/test_demo_full_example.xml similarity index 100% rename from examples/BaSyxNGINX/aas/test_demo_full_example.xml rename to examples/BaSyxReverseProxy/aas/test_demo_full_example.xml diff --git a/examples/BaSyxReverseProxy/apache/httpd.conf b/examples/BaSyxReverseProxy/apache/httpd.conf new file mode 100644 index 000000000..7c8c51402 --- /dev/null +++ b/examples/BaSyxReverseProxy/apache/httpd.conf @@ -0,0 +1,63 @@ +# Minimal Apache HTTP Server configuration for reverse proxy + +ServerRoot "/usr/local/apache2" +Listen ${PORT} +ServerName ${HOSTNAME} +ErrorLog /dev/stderr +CustomLog /dev/stdout combined +User daemon +Group daemon + +# Load required modules +LoadModule mpm_event_module modules/mod_mpm_event.so +LoadModule unixd_module modules/mod_unixd.so +LoadModule log_config_module modules/mod_log_config.so +LoadModule authz_core_module modules/mod_authz_core.so +LoadModule proxy_module modules/mod_proxy.so +LoadModule proxy_http_module modules/mod_proxy_http.so +LoadModule headers_module modules/mod_headers.so + +# Virtual host for reverse proxy + + + Require all granted + + + # Configuration for the AAS Environment + ProxyPass /aas-environment/ http://aas-env:8081/aas-environment/ + ProxyPassReverse /aas-environment/ http://aas-env:8081/aas-environment/ + + # Configuration for the AAS Registry + ProxyPass /aas-registry/ http://aas-registry:8080/aas-registry/ + ProxyPassReverse /aas-registry/ http://aas-registry:8080/aas-registry/ + + # Configuration for the AAS Registry 2 + ProxyPass /aas-registry-2/ http://aas-registry-2:8080/aas-registry-2/ + ProxyPassReverse /aas-registry-2/ http://aas-registry-2:8080/aas-registry-2/ + + # Configuration for the Submodel Registry + ProxyPass /sm-registry/ http://sm-registry:8080/sm-registry/ + ProxyPassReverse /sm-registry/ http://sm-registry:8080/sm-registry/ + + # Configuration for the Submodel Registry 2 + ProxyPass /sm-registry-2/ http://sm-registry-2:8080/sm-registry-2/ + ProxyPassReverse /sm-registry-2/ http://sm-registry-2:8080/sm-registry-2/ + + # Configuration for the AAS Discovery Service + ProxyPass /aas-discovery/ http://aas-discovery:8081/aas-discovery/ + ProxyPassReverse /aas-discovery/ http://aas-discovery:8081/aas-discovery/ + + # Configuration for the AAS Web UI (aas-gui path) + ProxyPass /aas-gui/ http://aas-web-ui:3000/aas-gui/ + ProxyPassReverse /aas-gui/ http://aas-web-ui:3000/aas-gui/ + # Remove X-Frame-Options and Content-Security-Policy headers + Header unset X-Frame-Options + Header unset Content-Security-Policy + # Add custom security headers for iframe embedding + Header always set Content-Security-Policy "frame-ancestors 'self' https://demo3.digital-twin.host" + Header always set X-Frame-Options "ALLOW-FROM https://demo3.digital-twin.host" + + # Configuration for the SPS Demonstrator UI (root path) + ProxyPass / http://sps-demonstrator-ui:3000/ + ProxyPassReverse / http://sps-demonstrator-ui:3000/ + \ No newline at end of file diff --git a/examples/BaSyxNGINX/basyx/aas-discovery.properties b/examples/BaSyxReverseProxy/basyx/aas-discovery.properties similarity index 100% rename from examples/BaSyxNGINX/basyx/aas-discovery.properties rename to examples/BaSyxReverseProxy/basyx/aas-discovery.properties diff --git a/examples/BaSyxNGINX/basyx/aas-env.properties b/examples/BaSyxReverseProxy/basyx/aas-env.properties similarity index 100% rename from examples/BaSyxNGINX/basyx/aas-env.properties rename to examples/BaSyxReverseProxy/basyx/aas-env.properties diff --git a/examples/BaSyxNGINX/docker-compose.yml b/examples/BaSyxReverseProxy/docker-compose.yml similarity index 95% rename from examples/BaSyxNGINX/docker-compose.yml rename to examples/BaSyxReverseProxy/docker-compose.yml index 6e8e2d698..4333ac649 100644 --- a/examples/BaSyxNGINX/docker-compose.yml +++ b/examples/BaSyxReverseProxy/docker-compose.yml @@ -1,12 +1,12 @@ services: - # nginx - nginx: - image: nginx:alpine - container_name: nginx + # apache + apache: + image: httpd:alpine + container_name: apache ports: - "80:80" volumes: - - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro + - ./apache/httpd.conf:/usr/local/apache2/conf/httpd.conf:ro restart: always depends_on: aas-env: