This commit is contained in:
2022-03-17 21:48:31 +00:00
parent 8b7ec7ee2f
commit 86fbc58a4a

View File

@@ -405,13 +405,13 @@ If this is a **new install dedicated to AyaNova only** and no existing NGINX ser
Switch to the NGINX configuration folder:
```bash
cd /etc/nginx/sites-enabled
cd /etc/nginx/sites-available
```
Make a backup copy of the existing `default` config file to your HOME folder just in case (note: you cannot backup to the same folder or NGINX will attempt to load it):
Make a backup copy of the existing `default` config file to your HOME folder just in case:
```bash
cp /etc/nginx/sites-enabled/default ~/nginx-default-backup
cp /etc/nginx/sites-available/default ~/nginx-default-backup
```
Open the existing `default` config file in an editor, replace it's contents **entirely** with the following configuration and save:
@@ -427,7 +427,7 @@ delete all text and replace it with this text:
```
server {
listen 80;
#server_name ayanova.example.com www.ayanova.example.com;
#server_name ayanova.example.com;
location / {
proxy_pass http://127.0.0.1:7575;
proxy_http_version 1.1;
@@ -470,6 +470,8 @@ Confirm that you can now navigate to AyaNova web app login page through **un-enc
Once DNS has propagated and you see the AyaNova web app login page (or license agreement page) over **unecrypted** HTTP it's time for the next step.
NOTE: In some cases the browser may not allow you to open an unecrypted HTTP site and will keep attempting to open with HTTPS instead, if this is the case and you don't receive an error about the domain being unknown then it's probably safe to just skip to the next step.
If DNS has propogated but you see an NGINX error page instead, confirm that AyaNova server is up and running and re-check the NGINX configuration.
### Add domain name to NGNIX config
@@ -487,18 +489,25 @@ sudo apt install certbot python3-certbot-nginx
Request a certificate from Let's Encrypt for the domain or subdomains previously registered and set in the NGINX config file:
```bash
sudo certbot --nginx -d ayanova.example.com -d www.ayanova.example.com
sudo certbot --nginx -d ayanova.example.com
```
(Each separate server name and dns record can be appended to the command line with `-d [YOUR_DOMAIN]`)
Accept the prompts choose the option to redirect to https. Certbot will re-write the default config file to properly include the https ports and SSL certificates.
If you get the following error you may have forgot to [add the domain name to NGINX config](#add-domain-name-to-ngnix-config):
```
Could not automatically find a matching server block for ayanova.example.com. Set the `server_name` directive to use the Nginx installer.
```
The NGINX default config file will now have new entries looking something like this:
```
server {
server_name ayanova.example.com www.ayanova.example.com;
server_name ayanova.example.com;
location / {
proxy_pass http://127.0.0.1:7575;
proxy_http_version 1.1;
@@ -511,21 +520,21 @@ server {
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/green.helloayanova.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/green.helloayanova.com/privkey.pem; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/ayanova.example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/ayanova.example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = green.helloayanova.com) {
if ($host = ayanova.example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name ayanova.example.com www.ayanova.example.com;
server_name ayanova.example.com;
return 404; # managed by Certbot