Note |
---|
These are instructions for flex.bi private 4.0 and later |
...
- Go to the /etc/nginx/conf.d on your server.
- Create a new file in this directory and name it accordingly, for example, flexbi.conf.
Use your preferred text editor to insert the following configuration information into the newly created configuration file:
Code Block proxy_http_version 1.1; proxy_set_header Connection ""; server { listen 80; server_name example.com; root /home/flexbi/flexbi_private/public/flexbi; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_set_header Cookie "$http_cookie;nginxremoteaddr=$remote_addr"; proxy_set_header X_FORWARDED_PROTO $scheme; proxy_pass http://127.0.0.1:8080; proxy_cache_valid 200 302 60m; } access_log /var/log/nginx/nginx.vhost.access.log; error_log /var/log/nginx/nginx.vhost.error.log; }
Note In the configuration above, replace example.com with your domain name which has a hostname configured for this server in DNS records.
Run the following command to reload nginx and apply the new configuration:
Code Block sudo systemctl reload nginx
Note To test if everything is working, open your website in a web browser using http:// (e.g. https://example.com).
Obtain a Certificate
You can use Certbot to obtain SSL certificates using various plugins. We will use nginx plugin which takes care of reconfiguring nginx and reloading the configuration whenever necessary.
Run the following command to obtain a certificate for your domain:
Code Block |
---|
sudo certbot --nginx -d example.com |
...