1.4 KiB
Nginx with Php-Fpm install script for Ubuntu 22.04 server
Prerequisites
An Ubuntu 22.04 server. Due to the difference in php versions between 20.04 22.04 this script will NOT work on Ubuntu 20.04.
Download the script
git clone https://git.x-files.dk/ubuntu-server-apps/nginx-install.git
Usage
cd nginx-install
sudo ./nginxinstall
Nginx configuration contains the following
A directory called nginxsnippets located in /etc/nginx. This directory contains snippets for use with nginx in order to try and have as clean and readable configuration files as possible.
Cloudflare Real IP configuration. I order to see the proxied ip addresses when users are comming from cloudflare.
The default website answering on IP address is disabled and will send a 444 i.e drop the tcp connection this is by my design feal free to change it.
Bad Bots blocking file blocking CSP and SSL settings. Modify as you see fit.
Custom error pages. You can modify them to your needs they are residing in /etc/nginxsnippets/errorpages
Notes
This setup is really doing some heavy lifting due the the enhanced caching that has been configured. If this turns out to be an issue just comment out the lines containing the caching configuration as well as opcache configuration in php.ini.
Post install
Nothing to do.
More guides
More guides can be found on [wiki.xfiles.dk]
Last tested
January 12th 2024 on Ubuntu 22.04.