apt-get update
apt-get install nginx
systemctl start nginx
systemctl enable nginx
systemctl status nginx
server {
listen 7002 ssl;
server_name crossroadscambodia.org;
ssl_certificate /opt/https-httpd/fullchain.pem;
ssl_certificate_key /opt/https-httpd/privkey.pem;
location / {
proxy_pass http://192.168.10.111:7001; # URL of cr-web-backend service
proxy_set_header Host $host;
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;
}
}
>>> Update /opt/https-httpd/fullchain.pem and /opt/https-httpd/privkey.pem with the paths to your SSL certificate and key files.
>>> If you don't have SSL certificates, you may generate using this guideline: https://github.com/rongroeung/apache-httpd-https?tab=readme-ov-file#i-generate-ssltls-certificate
nginx -t
>>> If the test is successful, you should see: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok.
systemctl restart nginx