NGINX
To run the Axidian CertiFlow server components on Linux, configure the nginx web server as a reverse proxy server.
- Install nginx.
- Install a TLS/SSL certificate.
- Configure the web server configuration file.
Follow the instructions for the operating system of the workstation where you plan to install nginx.
- RHEL-based
- Debian-based
Install nginx
Before you install nginx, set up the nginx packages repository. If the repository has not been set up automatically, add it manually.
Install the packages required to connect to the Yum repository:
sudo yum install yum-utilsTo connect to the Yum repository, create a file named /etc/yum.repos.d/nginx.repo with the following content.
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=trueTo install nginx, execute the following command.
sudo yum install nginx
If prompted to verify the GPG key, ensure its fingerprint matches 573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62.
For more information about nginx installation, see the NGINX website.
Install a TLS/SSL certificate
How to issue a TLS/SSL certificate
Install a TLS/SSL certificate on the web server.
Copy the certificate and private key files to the catalogs specified in the nginx configuration file.
sudo cp ./SSL.crt /etc/ssl/certs/
sudo cp ./SSL.key /etc/ssl/private/Add the root CA certificate to the trusted certificates store on the workstation running nginx.
sudo cp ./ca.crt /etc/pki/ca-trust/source/anchors/
sudo update-ca-trust extractMake the certificate trusted across the domain. For example, distribute it through Group Policies.
Grant the nginx system user read access to the certificate files.
Edit the nginx configuration file
Configure Nginx to accept web requests and proxy them to the Axidian CertiFlow service.
Nginx and its modules operate according to the settings defined in the main configuration file, nginx.conf. Depending on your operating system, this file is located in the /usr/local/nginx/conf, /etc/nginx, or /usr/local/etc/nginx catalog.
Recommended directives
| Context | Directive | Default value | Recommended value | Comment |
|---|---|---|---|---|
| http | proxy_buffer_size | 4k | 8k | 16k | Increases the proxy buffer size to handle necessary information in HTTP requests. |
| proxy_buffers | 8 4k | 8 8k | 4 16k | Increases the proxy buffer size to handle necessary information in HTTP requests. | |
| types_hash_max_size | 1024 | 4096 | Increases the hash table size to store information due to the large number of proxied services. | |
| client_max_body_size | 1m | 10m | Increases the allowed maximum size of files uploaded to the system. | |
| server | listen | 80 | 443 ssl | Changes the listening port to HTTPS protocol; nginx is configured for HTTP by default. |
| listen | — | 3003 ssl | Port 3003 is specified for an additional server context when using the Axidian CertiFlow agent. | |
| ssl_certificate | — | /etc/ssl/private/SSL.crt | For HTTPS operation, specifies the path to the certificate chain file (SSL certificate, intermediate and root CA certificates). | |
| ssl_certificate_key | — | /etc/ssl/private/SSL.key | For HTTPS operation, specifies the path to the SSL certificate's private key. | |
| ssl_verify_client | off | optional_no_ca | Added for certificate-based authentication (used by client agents). | |
| location | proxy_pass | — | * | * One location context directs requests to a single address—the Axidian CertiFlow service. Therefore, there should be as many location contexts as there are Axidian CertiFlow services. The proxy endpoint is specified in the format: http://localhost:PORT/certiflow/SERVICENAME http://localhost:PORT/AGENTSERVICENAME Where PORT is the port on which the Axidian CertiFlow service is running, and SERVICENAME and AGENTSERVICENAME are the names of the running services. |
| include | — | /etc/nginx/conf.d/proxy.conf | Some directives are described for each location. For a more compact configuration file, it is recommended to create a file with a commonly used set of directives and include it in each location instead of writing the entire set repeatedly. | |
| proxy_http_version | 1.0 | 1.1 | Version 1.1 is recommended for keepalive connections and NTLM authentication. | |
| proxy_cache_bypass | — | $http_upgrade | Defines conditions under which a response will not be taken from the cache. | |
| proxy_set_header | — | Upgrade $http_upgrade | Specifies switching from HTTP/1.1 to WebSocket after establishing a connection. | |
| — | Connection keep-alive | For using keepalive connections. | ||
| — | Host $host | To preserve the nginx server name in headers when passing them to Axidian CertiFlow services. | ||
| — | X-Real-IP $remote_addr | By default, operating in reverse proxy mode uses non-standard headers for the user's IP address, requiring this directive. | ||
| — | X-Forwarded-For $proxy_add_x_forwarded_for | Similar to X-Real-IP $remote_addr, defines the formation of a header for correct proxying. If the X-Forwarded-For field was not present in the original header, then $proxy_add_x_forwarded_for = $remote_addr. | ||
| proxy_set_header | — | X-Forwarded-Proto $scheme | The web server accepts requests via HTTPS and proxies them to HTTP Axidian CertiFlow services for correct protocol substitution. | |
| fastcgi_buffers | 8 4k | 8k | 16 16k | Defines the number and size of buffers for reading responses from a FastCGI server, per connection. | |
| fastcgi_buffer_size | 4k | 8k | 32k | Defines the buffer size for reading the first part of a response from a FastCGI server. | |
| proxy_set_header | — | x-ssl-client-cert $ssl_client_escaped_cert | Passes the client certificate when proxying. Used by client agents for certificate-based authentication. |
Using multiple location blocks in the configuration leads to repeating the same set of directives. To simplify the configuration process, extract the common set of directives into a separate file. Then, use the include directive within each location context to reference that file.
Create a file for the reusable directives. You can place this file in CONF format in the /etc/nginx/conf.d/ catalog.
Recommended proxy.conf file content for Axidian CertiFlow compatibilityproxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
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;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;Configure the main nginx configuration file. The
locationcontext names must match the path to the proxied service.Nginx.conf example
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
events { worker_connections 1024; }
http {
proxy_buffer_size 64k;
proxy_buffers 4 64k;
types_hash_max_size 4096;
add_header X-Frame-Options sameorigin always;
add_header X-Content-Type-Options nosniff;
log_format main '[$time_local] $remote_addr VIA $scheme --- $status --- $request \n $ssl_client_fingerprint';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
listen 443 ssl;
server_name $hostname;
ssl_certificate "/etc/ssl/certs/SSL.crt";
ssl_certificate_key "/etc/ssl/private/SSL.key";
location /certiflow/mc
{ include /etc/nginx/conf.d/proxy.conf; proxy_pass http://localhost:5001/certiflow/mc; }
location /certiflow/ss
{ include /etc/nginx/conf.d/proxy.conf; proxy_pass http://localhost:5002/certiflow/ss; }
location /certiflow/rss
{ include /etc/nginx/conf.d/proxy.conf; proxy_pass http://localhost:5003/certiflow/rss; }
location /certiflow/api
{ include /etc/nginx/conf.d/proxy.conf; proxy_pass http://localhost:5004/certiflow/api; }
location /certiflow/credprovapi
{ include /etc/nginx/conf.d/proxy.conf; proxy_pass http://localhost:5005/certiflow/credprovapi; }
location /certiflow/oidc
{ include /etc/nginx/conf.d/proxy.conf; proxy_pass http://localhost:5008/certiflow/oidc; }
location /certiflow/wizard
{ proxy_pass http://localhost:5009; }
#location /api
#{ include /etc/nginx/conf.d/proxy.conf; proxy_pass http://localhost:5010/api; }
}
server {
listen 3003 ssl;
server_name $hostname;
ssl_certificate "/etc/ssl/certs/SSL.crt";
ssl_certificate_key "/etc/ssl/private/SSL.key";
ssl_verify_client optional_no_ca;
location /agentregistrationapi
{ include /etc/nginx/conf.d/proxy.conf; proxy_pass http://localhost:5006/agentregistrationapi; }
location /agentserviceapi
{ include /etc/nginx/conf.d/proxy.conf; proxy_pass http://localhost:5007/agentserviceapi;
proxy_set_header x-ssl-client-cert $ssl_client_escaped_cert; }
}
}To apply the changes in the configuration file, reload the configuration or restart nginx. To reload the configuration, execute the following command.
sudo nginx -s reload
Install nginx
Install the packages required to connect to the Yum repository:
Ubuntusudo apt install curl gnupg2 ca-certificates lsb-release ubuntu-keyringDebiansudo apt install curl gnupg2 ca-certificates lsb-release debian-archive-keyringImport the official GPG key used by apt to authenticate packages:
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/nullConnect to the Yum repository.
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" | sudo tee /etc/apt/sources.list.d/nginx.listExecute the following commands.
sudo apt update
sudo apt install nginx
For more information about nginx installation, see the NGINX website.
Install a TLS/SSL certificate
How to issue a TLS/SSL certificate
Install a TLS/SSL certificate on the web server.
Copy the certificate and private key files to the catalogs specified in the nginx configuration file.
sudo cp ./SSL.crt /etc/ssl/certs/
sudo cp ./SSL.key /etc/ssl/private/Add the root CA certificate to the trusted certificates store on the workstation running nginx:
sudo cp ./ca.crt /usr/local/share/ca-certificates/
sudo update-ca-certificates -fMake the certificate trusted across the domain. For example, distribute it through Group Policies.
Grant the www-data system user read access to the certificate files.
Edit the nginx configuration file
Configure Nginx to accept web requests and proxy them to the Axidian CertiFlow service.
Nginx and its modules operate according to the settings defined in the main configuration file, nginx.conf. Depending on your operating system, this file is located in the /usr/local/nginx/conf, /etc/nginx, or /usr/local/etc/nginx catalog.
Recommended directives
| Context | Directive | Default value | Recommended value | Comment |
|---|---|---|---|---|
| http | proxy_buffer_size | 4k | 8k | 16k | Increases the proxy buffer size to handle necessary information in HTTP requests. |
| proxy_buffers | 8 4k | 8 8k | 4 16k | Increases the proxy buffer size to handle necessary information in HTTP requests. | |
| types_hash_max_size | 1024 | 4096 | Increases the hash table size to store information due to the large number of proxied services. | |
| client_max_body_size | 1m | 10m | Increases the allowed maximum size of files uploaded to the system. | |
| server | listen | 80 | 443 ssl | Changes the listening port to HTTPS protocol; nginx is configured for HTTP by default. |
| listen | — | 3003 ssl | Port 3003 is specified for an additional server context when using the Axidian CertiFlow agent. | |
| ssl_certificate | — | /etc/ssl/private/SSL.crt | For HTTPS operation, specifies the path to the certificate chain file (SSL certificate, intermediate and root CA certificates). | |
| ssl_certificate_key | — | /etc/ssl/private/SSL.key | For HTTPS operation, specifies the path to the SSL certificate's private key. | |
| ssl_verify_client | off | optional_no_ca | Added for certificate-based authentication (used by client agents). | |
| location | proxy_pass | — | * | * One location context directs requests to a single address—the Axidian CertiFlow service. Therefore, there should be as many location contexts as there are Axidian CertiFlow services. The proxy endpoint is specified in the format: http://localhost:PORT/certiflow/SERVICENAME http://localhost:PORT/AGENTSERVICENAME Where PORT is the port on which the Axidian CertiFlow service is running, and SERVICENAME and AGENTSERVICENAME are the names of the running services. |
| include | — | /etc/nginx/conf.d/proxy.conf | Some directives are described for each location. For a more compact configuration file, it is recommended to create a file with a commonly used set of directives and include it in each location instead of writing the entire set repeatedly. | |
| proxy_http_version | 1.0 | 1.1 | Version 1.1 is recommended for keepalive connections and NTLM authentication. | |
| proxy_cache_bypass | — | $http_upgrade | Defines conditions under which a response will not be taken from the cache. | |
| proxy_set_header | — | Upgrade $http_upgrade | Specifies switching from HTTP/1.1 to WebSocket after establishing a connection. | |
| — | Connection keep-alive | For using keepalive connections. | ||
| — | Host $host | To preserve the nginx server name in headers when passing them to Axidian CertiFlow services. | ||
| — | X-Real-IP $remote_addr | By default, operating in reverse proxy mode uses non-standard headers for the user's IP address, requiring this directive. | ||
| — | X-Forwarded-For $proxy_add_x_forwarded_for | Similar to X-Real-IP $remote_addr, defines the formation of a header for correct proxying. If the X-Forwarded-For field was not present in the original header, then $proxy_add_x_forwarded_for = $remote_addr. | ||
| proxy_set_header | — | X-Forwarded-Proto $scheme | The web server accepts requests via HTTPS and proxies them to HTTP Axidian CertiFlow services for correct protocol substitution. | |
| fastcgi_buffers | 8 4k | 8k | 16 16k | Defines the number and size of buffers for reading responses from a FastCGI server, per connection. | |
| fastcgi_buffer_size | 4k | 8k | 32k | Defines the buffer size for reading the first part of a response from a FastCGI server. | |
| proxy_set_header | — | x-ssl-client-cert $ssl_client_escaped_cert | Passes the client certificate when proxying. Used by client agents for certificate-based authentication. |
Using multiple location blocks in the configuration leads to repeating the same set of directives. To simplify the configuration process, extract the common set of directives into a separate file. Then, use the include directive within each location context to reference that file.
Create a file for the reusable directives. You can place this file in CONF format in the /etc/nginx/conf.d/ catalog.
Recommended proxy.conf file content for Axidian CertiFlow compatibilityproxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
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;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;Configure the main nginx configuration file. The
locationcontext names must match the path to the proxied service.Nginx.conf example
user www-data;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
events { worker_connections 1024; }
http {
proxy_buffer_size 64k;
proxy_buffers 4 64k;
types_hash_max_size 4096;
add_header X-Frame-Options sameorigin always;
add_header X-Content-Type-Options nosniff;
log_format main '[$time_local] $remote_addr VIA $scheme --- $status --- $request \n $ssl_client_fingerprint';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
listen 443 ssl;
server_name $hostname;
ssl_certificate "/etc/ssl/certs/SSL.crt";
ssl_certificate_key "/etc/ssl/private/SSL.key";
location /certiflow/mc
{ include /etc/nginx/conf.d/proxy.conf; proxy_pass http://localhost:5001/certiflow/mc; }
location /certiflow/ss
{ include /etc/nginx/conf.d/proxy.conf; proxy_pass http://localhost:5002/certiflow/ss; }
location /certiflow/rss
{ include /etc/nginx/conf.d/proxy.conf; proxy_pass http://localhost:5003/certiflow/rss; }
location /certiflow/api
{ include /etc/nginx/conf.d/proxy.conf; proxy_pass http://localhost:5004/certiflow/api; }
location /certiflow/credprovapi
{ include /etc/nginx/conf.d/proxy.conf; proxy_pass http://localhost:5005/certiflow/credprovapi; }
location /certiflow/oidc
{ include /etc/nginx/conf.d/proxy.conf; proxy_pass http://localhost:5008/certiflow/oidc; }
location /certiflow/wizard
{ proxy_pass http://localhost:5009; }
#location /api
#{ include /etc/nginx/conf.d/proxy.conf; proxy_pass http://localhost:5010/api; }
}
server {
listen 3003 ssl;
server_name $hostname;
ssl_certificate "/etc/ssl/certs/SSL.crt";
ssl_certificate_key "/etc/ssl/private/SSL.key";
ssl_verify_client optional_no_ca;
location /agentregistrationapi
{ include /etc/nginx/conf.d/proxy.conf; proxy_pass http://localhost:5006/agentregistrationapi; }
location /agentserviceapi
{ include /etc/nginx/conf.d/proxy.conf; proxy_pass http://localhost:5007/agentserviceapi;
proxy_set_header x-ssl-client-cert $ssl_client_escaped_cert; }
}
}To apply the changes in the configuration file, reload the configuration or restart nginx. To reload the configuration, execute the following command.
sudo nginx -s reload