Skip to main content

NGINX

Think of NGINX as a very efficient traffic controller for websites. When you type a web address, NGINX sits in front of your site’s servers and quickly figures out where each request should go—whether that’s serving up a simple image or handing off a more complex request to another program. Because it’s built to juggle thousands of users at once without slowing down, many big sites use NGINX to keep pages loading fast and their systems running smoothly.

ABAIR Uses NGINX for

  1. Web server
  2. Reverse proxy.

Services running on NGINX

You can ls /etc/nginx/sites-available to see all the web apps running on nginx. To setup a new web app see Setting up NGINX.

Reverse Proxy Config

server {
listen 80;
server_name <domain>;
return 301 https://$server_name$request_uri;
}

server {
listen 443 ssl;
listen [::]:443 ssl;
server_name <domain>;

access_log /etc/nginx/log/access_$server_name.log;
error_log /etc/nginx/log/error_$server_name.log;

ssl_certificate /etc/nginx/ssl/<domain>.pem;
ssl_certificate_key /etc/nginx/ssl/<domain>.pem;

location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://10.0.0.X:PORT;
}
}

Note: Remove block prefix from path provided to upstream server. e.g. /v3/

# Remove the /v3/ prefix from the request URI
rewrite ^/v3(.*)$ $1 break;