Question
How is it possible to set up authentication for REST API FineReader Server 14 and Document Conversion Service calls, using the nginx HTTP-server and httpd?
Answer
To do this, please
1. Set up the FineReader Server 14 website as follows:
·Open IIS Manager.
·In the Connections pane, expand Sites and the name of the server and select FineReader Server 14.
·In the Actions pane, select Bindings…
·Change the http Port from 8080 to 8079.
·Restart the website by clicking Restart in the Manage Website pane.
2. Create a key file using htpasswd:
·Download Apache from the official Apache website and unpack it to the root folder of drive C:\.
·Save the key file to the root folder of drive C:\. To do so, run the following command:
C:\Apache24\bin\htpasswd -c c:\ nginx\conf\pass user1,
where user1 refers to the user and pass to the name of the key file.
· It is needed to enter the password for user1 twice when running the command.
·To add a new user to an existing key file, run the following command:
C:\Apache24\bin\htpasswd c:\ nginx\conf\pass user2
·To verify that passwords have been created for all users, open the C:\pass file in Notepad:
user1:$apr1$8J02UMct$ElvPUHOsnAfj3ez0RSUoc/
user2:$apr1$zaBuoJjA$gZPUSmkxGI.DdSSdqLwqh1
3. Set up nginx:
·Download nginx for Windows from the official nginx website and extract the installation package to the root folder of drive C:\.
·In the nginx/conf folder, open the key file and make sure that it looks like the following:
…
http {
…
server {
listen 8080;
server_name localhost;
location /FineReaderServer14{
proxy_pass http://localhost:8079;
auth_basic "Restricted Area";
auth_basic_user_file c:/nginx/conf/pass;
}
…
}
listen 8080 refers to the port that will be used by REST API FineReader Server 14 and the Document Conversion Service to send requests,
proxy_pass http://localhost:8079; is the port for the Document Conversion Service website,
and auth_basic_user_file c:/nginx/conf/pass is the path to the key file created using htpasswd.
4. Launch nginx:
·Run the following command:
start C:\nginx-1.21.0\ nginx.exe
·Verify that the process is running:
tasklist /fi "imagename eq nginx.exe"
Image Name | PID Session Name | Session# | Mem Usage |
nginx.exe | 3352 31C5CE94259D4006 | 2 | 6,960 K |
nginx.exe | 6432 31C5CE94259D4006 | 2 | 7,620 K |
The above will set up basic authentication for nginxHostName:8080/FineReaderServer14 calls.
Comments
0 comments
Article is closed for comments.