HENGSHI SENSE Third-Party Software Configuration FAQ
Nginx Related Configuration
Is there a size limit for uploading files?
The product requires that uploaded files do not exceed 50MB. If configuring a reverse proxy, you need to set the upload file size. For example, in Nginx, configure it as follows.
nginx configuration file /etc/nginx/nginx.conf, configure in the corresponding server
client_max_body_size 100m;
### How to set the timeout?
Set the timeout in the configuration file.
nginx configuration file /etc/nginx/nginx.conf, configure in the corresponding server
proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; send_timeout 600;
### How to Serve Through Ports 80 and 443?
HENGSHI SENSE cannot be started as root, so it cannot bind to ports lower than 1024. To listen on ports 80 and 443, it is recommended to use nginx as a reverse proxy. Create a configuration file /etc/nginx/conf.d/hengshi.conf with the following content.
```
# hengshi proxy
upstream hengshi-proxy {
server $IP:$PORT;
}
server {
server_name $SERVNAME;
access_log /var/log/nginx/access.log main;
listen 80;
location / {
proxy_pass http://hengshi_proxy;
}
}
server {
server_name $SERVNAME
listen 443 ssl http2; # Be sure to configure https 2.0 to improve browser request concurrency
access_log /var/log/nginx/access.log main;
gzip on; # Enable gzip compression to optimize page loading speed
gzip_vary on;
client_max_body_size 200M;
proxy_connect_timeout 900;
proxy_read_timeout 900;
proxy_send_timeout 900;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:!DSS';
ssl_prefer_server_ciphers on;
ssl_session_timeout 5m;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
ssl_certificate $PATH_TO_CER
ssl_certificate_key $PATH_TO_CER_KEY
add_header Strict-Transport-Security "max-age=31536000" always;
location / {
# The following X-Forwarded-Host and X-Forwarded-Proto settings are necessary for SSO scenarios, do not omit!
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://hengshi-proxy;
}
}
```
In which, variables need to be replaced with real values.
* IP: The IP of the machine where HENGSHI is deployed.
* PORT: The port bound by the HENGSHI service.
* SERVNAME: The hostname used by Nginx to provide services.
* PATH_TO_CER, PATH_TO_CER_KEY: The absolute paths of the cer/key files providing SSL services, respectively.