User Tools

Site Tools


nginx

This is an old revision of the document!


Nginx Things

Reference Notes

Actually pretty decent reference Nginx Beginners Guide

location

Nginx reference, https://nginx.org/en/docs/http/ngx_http_core_module.html#location

    location / {
        root /data/www;
    }

/ refers to the URI, so in this case the root URI
So the above returns files in /data/www

    location /images/ {
        root /data;
    }

Returns files in /data/images/

    location ~ \.(gif|jpg|png)$ {
        root /data/images;
    }

~ means the following is a regex. In this case, every address ending on gif, jpg, or png will return a file from /data/images

Examples

Basic Proxy Pass

server {
	listen 80;
	listen [::]:80;

	server_name cloud.lexrudera.net cloud.pulsewave.co;
	
	access_log /var/log/nginx/access-nextcloud80.log;
	error_log /var/log/nginx/error-nextcloud80.log;

	client_max_body_size 10G;
	fastcgi_buffers 64 4k;

	location / {
		proxy_pass http://192.168.0.102:8080;
	}
}

Basic UWSGI Pass

Like to a Gunicorn instance.

server
{
	listen 80;
	server_name radiotest.kirin.software;	
	
	location ~ {
		include uwsgi_params;
		uwsgi_pass unix:/var/run/uwsgi/radiotest.sock;
	}
}
nginx.1767788983.txt.gz · Last modified: by lex

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki