Step 1. Install NGINX. Step 2. Customize the firewall. Step 3. Check the status of NGINX web server. Step 4. Create and customize 'server blocks'. Here is an example of wscservice configuration file for NGINX. Step 5. Create symlink for the 'wscservice' file. Step 6. Restart NGINX. Step 7. NGINX troubleshooting if the restart fails. Probably the default NGINX config already uses the 80/443 port or you added an extra curly brace.sudo apt-get update
sudo apt-get install nginx
sudo ufw allow 'Nginx Full'
systemctl status nginx
sudo cd /etc/nginx/sites-available/
sudo cp default wscservice
sudo nano wscservice
# Default server configuration
#
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
server_name wscservice;
# bindings of static files
location /wscservice/ {
alias /opt/WSC/WebComponents/WebInterface/;
autoindex on;
index index.html index.htm;
location /wscservice/samples/ {
alias /opt/WSC/WebComponents/Samples/;
autoindex on;
index index.html index.htm;
}
location /wscservice/wscbundle/ {
alias /opt/WSC/WebComponents/WebInterface/wscbundle/;
autoindex on;
add_header Access-Control-Allow-Origin '*';
}
# reverse proxy for proxying requests to AppServer
location /wscservice/api {
# location /wscservice/api/ with a slash for WebSpellChecker versions 5.15.0.0 only
proxy_pass http://your_host:2880;
}
}
}
ln -s /etc/nginx/sites-available/wscservice /etc/nginx/sites-enabled/wscservice
sudo systemctl restart nginx
sudo nginx -t
wscservice