Friday, May 25, 2018

Nginx with LUA and Java handlers

sudo yum install epel-release
sudo yum install nginx
sudo systemctl start nginx

nginx should now be running, enter http://localhost to test

documents in /usr/share/nginx/html

configuration in /etc/nginx/nginx.conf

logs in /var/log/nginx/access.log

sudo ausearch -c 'nginx' --raw | audit2allow -M my-nginx
sudo semodule -i my-nginx.pp
#disable selinux
setenforce 0

nginx with Docker
docker pull nginx
docker run --name nginx -d -p 10080:80 nginx

Setup a reverse proxy:
sudo vi /etc/nginx/conf.d/mynexus.conf

    listen 18081;
    location / {
        proxy_pass "http://localhost:8081";

systemctl stop nginx
systemctl start nginx

you can now point your maven mirror in settings.xml to point to 18081 and intercept all requests to Nexus

How to embed a Java handler in the loop ?

Handlers in Java implement this interface NginxJavaRingHandler

Ref: quick quide to configure

nginx as reverse proxy

No comments: