One-Click Nginx Installation Script for CentOS with Reverse Proxy Support

centos nginx installationnginx reverse proxy scriptnginx cdn accelerationngx_cache_purgeoneinstack alternative
Published·Modified·

Frequently needing to use Nginx as a reverse proxy, manual compilation and installation every time is too troublesome. Therefore, I wrote a one-click installation script that supports both compilation and binary installation.

Environment Requirements

  • CentOS 6/7

Installation

Yes, simply copy the command below and follow the prompts.

wget https://raw.githubusercontent.com/helloxz/nginx-cdn/master/nginx.sh && bash nginx.sh

Module Description

Although LNMP and OneInstack can also install Nginx separately, I chose not to use them because certain modules are missing, requiring recompilation. This script comes with modules commonly used for reverse proxy built-in. Key modules include:

Nginx Module Configuration

  • ngx_http_substitutions_filter_module: Keyword replacement module
  • ngx_cache_purge: Cache clearing module

Other Notes

For better results, refer to the following self-built CDN tutorials:

Script Source Code: https://github.com/helloxz/nginx-cdn