Skip to content

Commit bdd7d0c

Browse files
Corallopataxis
authored andcommitted
Remove possibility to use reverse proxy
Remove reverse proxy support and update documentation This change removes the possibility to use a reverse proxy with the application. It also updates the documentation to reflect this change and remove any outdated or incorrect information. Specifically, the following changes are included: - Remove the code and configuration related to reverse proxy support - Add a note in the documentation about the limitation of not supporting reverse proxies
1 parent ddad4cc commit bdd7d0c

File tree

1 file changed

+7
-24
lines changed

1 file changed

+7
-24
lines changed

web-server/README.md

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# How to use web server in ACAP version 4
44

5-
This document explains briefly how to build and use the [Monkey web server](https://github.com/monkey/monkey) in ACAP version 4. Monkey is a fast and lightweight web server for Linux. It has been designed to be very scalable with low memory and CPU consumption, the perfect solution for Embedded Linux and high-end production environments. Besides the common features as HTTP server, it expose a flexible C API which aims to behave as a fully HTTP development framework, so it can be extended as desired through the plugins interface. The Monkey web server [documentation](http://monkey-project.com/documentation/1.5) describes the configuration in detail.
5+
This document explains briefly how to build and use the [Monkey web server](https://github.com/monkey/monkey) in ACAP version 4. Monkey is a fast and lightweight web server for Linux. It has been designed to be very scalable with low memory and CPU consumption, the perfect solution for Embedded Linux and high-end production environments. Besides the common features as HTTP server, it expose a flexible C API which aims to behave as a fully HTTP development framework, so it can be extended as desired through the plugins interface.
66

77
## Structure of this application
88

@@ -27,31 +27,14 @@ Meet the following requirements to ensure compatibility with the example:
2727
* Either [Docker Desktop](https://docs.docker.com/desktop/) version 4.11.1 or higher,
2828
* or [Docker Engine](https://docs.docker.com/engine/) version 20.10.17 or higher with BuildKit enabled using Docker Compose version 1.29.2 or higher
2929

30-
## Limitations
30+
## Limitation
3131

32-
* Apache Reverse Proxy can not translate content with absolute addresses (e.g. `/image.png`) in the HTML page. Use only relative content (e.g. `image.png` or `../image.png`). More information how to handle relative URLs correctly with a reverse proxy [here](https://serverfault.com/questions/561892/how-to-handle-relative-urls-correctly-with-a-reverse-proxy).
33-
34-
## Configure Apache to forward HTTP requests
35-
36-
The Axis camera's web server can be accessed from a web browser either directly using a port number (e.g. <http://mycamera:2001>) or through the Apache server in the camera using a route (e.g. <http://mycamera/monkey/>). To configure the Apache server as a reverse proxy server, use the procedure shown below.
37-
38-
```sh
39-
# Do ssh login to the camera
40-
ssh root@<CAMERA_IP>
41-
42-
# Add reverse proxy configuration to the Apache server, example:
43-
cat >> /etc/apache2/httpd.conf <<EOF
44-
ProxyPass /monkey http://localhost:2001
45-
ProxyPassReverse /monkey http://localhost:2001
46-
EOF
47-
48-
# Restart the Apache server
49-
systemctl restart httpd
50-
```
32+
* From AXIS OS 12.0 it's no longer possible to set a reverse proxy configuration in Axis devices due to the removal of root access. This means that this example can only use the default configuration.
33+
* Note that it's possible to set a reverse proxy configuration in native ACAP applications, see the [web-server](https://github.com/AxisCommunications/acap-native-sdk-examples/tree/main/web-server) in acap-native-sdk-examples repo. Another native ACAP application using a web server is [web-server-using-fastcgi](https://github.com/AxisCommunications/acap-native-sdk-examples/tree/main/web-server-using-fastcgi).
5134

5235
## How to run the code
5336

54-
Start by building the Docker image containing the web server code with examples. This will compile the code to an executable and create a container containing the executable, which can be uploaded to and run on the camera. After the web server is started it can be accessed from a web browser by navigating to <http://mycamera/monkey/index.html> or <http://mycamera:2001>.
37+
Start by building the Docker image containing the web server code with examples. This will compile the code to an executable and create a container containing the executable, which can be uploaded to and run on the camera. After the web server is started it can be accessed from a web browser by navigating to http://<AXIS_DEVICE_IP>:2001.
5538

5639
### Build the Docker image
5740

@@ -123,11 +106,11 @@ Home : http://monkey-project.com
123106
[+] Linux Features: TCP_FASTOPEN SO_REUSEPORT
124107
```
125108

126-
With the Monkey web server running, navigate to <http://mycamera:8080/> to see the served web page. If you managed to configure the Apache reverse proxy, the same page is also served at <http://mycamera/monkey/>.
109+
With the Monkey web server running, navigate to http://<AXIS_DEVICE_IP>:2001 to see the served web page.
127110

128111
## C API Examples
129112

130-
Some C API examples are included in the web server container that has been built: `hello`, `list` and `quiz`. The current Docker image, starts the Monkey server `monkey` when using `CMD monkey` in the Dockerfile. To try another C API example, either re-build the Docker image with another `CMD` (i.e. `CMD hello`) or override it by using the `entrypoint` keyword in the `docker-compose.yml` file (i.e. `entrypoint: hello`). To see the result, use a web browser and navigate to <http://mycamera/monkey/> or <http://mycamera:2001>.
113+
Some C API examples are included in the web server container that has been built: `hello`, `list` and `quiz`. The current Docker image, starts the Monkey server `monkey` when using `CMD monkey` in the Dockerfile. To try another C API example, either re-build the Docker image with another `CMD` (i.e. `CMD hello`) or override it by using the `entrypoint` keyword in the `docker-compose.yml` file (i.e. `entrypoint: hello`). To see the result, use a web browser and navigate to http://<AXIS_DEVICE_IP>:2001.
131114

132115
## Proxy settings
133116

0 commit comments

Comments
 (0)