nginx

Install on FreeBSD 10.3

load_module /usr/local/libexec/nginx/ngx_mail_module.so;
load_module /usr/local/libexec/nginx/ngx_stream_module.so;

worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       80;
        server_name  localhost;

        location / {
            root   /usr/local/www/nginx;
            index  index.html index.htm;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/local/www/nginx-dist;
        }
    }

}

include /usr/local/etc/nginx/sslbalance.d/*;

stream{
   upstream backend {
       server 127.0.0.1:8443;
       server 127.0.0.1:8444;
    }

   server {
       listen 443;
       proxy_pass backend;
   }
}

Install on Slackware

   1 cd /tmp 
   2 wget https://slackbuilds.org/slackbuilds/14.2/network/nginx.tar.gz
   3 tar xvzf nginx.tar.gz
   4 cd nginx
   5 wget http://nginx.org/download/nginx-1.10.2.tar.gz
   6 ./nginx.SlackBuild
   7 installpkg  /tmp/nginx-1.10.2-x86_64-1_SBo.tgz
   8 
   9 /etc/rc.d/rc.httpd stop
  10 sh /etc/rc.d/rc.nginx start

nginx.conf with reverse proxy example

# nginx.conf
worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;


    server {
        listen       80;
        server_name  localhost;

        location / {
            root   /var/www/html;
            index  index.html index.htm;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /var/www/html;
        }
    }

    server{
          listen 80;
          server_name abc.example.org;
          location / { proxy_pass   http://127.0.0.1:8081; }
     }

    server {
      listen 80;
      server_name cde.example.org;
      location / {  proxy_pass   http://127.0.0.1:8082; }
    }

}

nginx (last edited 2017-02-04 11:53:23 by localhost)