Switching NGINX from Stable Branch to Mainline
Run
sudo apt remove nginx
to remove the current installation of NGINX while preserving the configuration files.Run
sudo apt install curl gnupg2 ca-certificates lsb-release
to install the prerequisites.Run the following to set up the repository for mainline packages:
echo "deb http://nginx.org/packages/mainline/ubuntu `lsb_release -cs` nginx" | sudo tee /etc/apt/sources.list.d/nginx.list
Run
curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add -
to import an official NGINX signing key so apt can verify the package's authenticity.Run
sudo apt-key fingerprint ABF5BD827BD9BF62
to verify you have the proper key.The output should contain the full fingerprint
573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62
.Run
sudo apt update
andsudo apt install nginx
.Run
sudo rm /etc/nginx/conf.d/default.conf
to remove the default configuration.Run
sudo vim /etc/nginx/nginx.conf
and addinclude /etc/nginx/sites-enabled/*;
below the lineinclude /etc/nginx/conf.d/*.conf;
.Run
sudo nginx -s reload
.Run
sudo service nginx stop
.Run
sudo service nginx start
.Run
netstat -tln
to check the server is listening on port 443 rather than 80.Check the PhixFlow application loads in the browser. Check the security settings in the browser console.
Run
nginx -V
to check the version.
Installing NGINX Mainline Directly
Run
sudo apt install curl gnupg2 ca-certificates lsb-release
to install the prerequisites.Run the following to set up the repository for mainline packages:
echo "deb http://nginx.org/packages/mainline/ubuntu `lsb_release -cs` nginx" | sudo tee /etc/apt/sources.list.d/nginx.list
Run
curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add -
to import an official NGINX signing key so apt can verify the package's authenticity.Run
sudo apt-key fingerprint ABF5BD827BD9BF62
to verify you have the proper key.The output should contain the full fingerprint
573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62
.Run
sudo apt update
andsudo apt install nginx
.Run
sudo rm /etc/nginx/conf.d/default.conf
to remove the default configuration.Run
sudo vim /etc/nginx/conf.d/phixflow.conf
and paste in the following, replacing[subdomain]
with the appropriate subdomain of the server:server { listen 443 ssl; listen [::]:443 ssl ipv6only=on; server_name [subdomain].phixflow.com; location / { proxy_pass http://127.0.0.1:8080; } ssl_certificate /etc/letsencrypt/live/[subdomain].phixflow.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/[subdomain].phixflow.com/privkey.pem; include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; client_max_body_size 40M; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"; }
Run
sudo nginx -s reload
.Run
sudo service nginx stop
.Run
sudo service nginx start
.Run
netstat -tln
to check the server is listening on port 443 rather than 80.Check the PhixFlow application loads in the browser. Check the security settings in the browser console.
Run
nginx -V
to check the version.