Reverse Proxy

Installing & Using Nginx HTTP (and Reverse Proxy) Server in Ubuntu LTS

2012-04-24. Category & Tags: HTTP, Server, Reverse Proxy

nginx is a great alternative to apache2, it is better to handle static web pages and files. another one is lighttpd which is optimized for long-time keep-alive (a lot of connections).

Install in Ubuntu #

18.04 ~ 22.04 LTS #

sudo apt install -y software-properties-common && sudo add-apt-repository ppa:nginx/stable

sudo apt update && \
sudo apt install -y nginx nginx-extras && \
systemctl status nginx

ref: digitalocean

10.04 LTS #

sudo -s
apt-get install gcc g++;
wget http://downloads.sourceforge.net/pcre/pcre-8.10.tar.bz2 (seems hard-coded version in nginx v1.2; otherwise, such as me, ln -s xxx.so.xxx ...); tar xvjf ...; cd ...; ./configure; make; make install;
cd nginx; ./configure --without-http_gzip_module (do not need and do not want in experiments); make; make install;
/usr/local/nginx/conf# vim nginx.conf; keepalive_timeout  0\. #server_name non-local???

the second time when i started it, it could start work, not the first time. do not know why. try nginx; nginx -s stop; nginx.

...