Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### /etc/php/8.1/fpm/pool.d/librenms.conf ###
- ; Start a new pool named 'librenms'.
- ; the variable $pool can be used in any directive and will be replaced by the
- ; pool name ('librenms' here)
- [librenms]
- ; Per pool prefix
- ; It only applies on the following directives:
- ; - 'access.log'
- ; - 'slowlog'
- ; - 'listen' (unixsocket)
- ; - 'chroot'
- ; - 'chdir'
- ; - 'php_values'
- ; - 'php_admin_values'
- ; When not set, the global prefix (or /usr) applies instead.
- ; Note: This directive can also be relative to the global prefix.
- ; Default Value: none
- ;prefix = /path/to/pools/$pool
- ; Unix user/group of processes
- ; Note: The user is mandatory. If the group is not set, the default user's group
- ; will be used.
- user = librenms
- group = librenms
- ; The address on which to accept FastCGI requests.
- ; Valid syntaxes are:
- ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
- ; a specific port;
- ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
- ; a specific port;
- ; 'port' - to listen on a TCP socket to all addresses
- ; (IPv6 and IPv4-mapped) on a specific port;
- ; '/path/to/unix/socket' - to listen on a unix socket.
- ; Note: This value is mandatory.
- listen = /run/php-fpm-librenms.sock
- ; Set listen(2) backlog.
- ; Default Value: 511 (-1 on FreeBSD and OpenBSD)
- ;listen.backlog = 511
- ; Set permissions for unix socket, if one is used. In Linux, read/write
- ; permissions must be set in order to allow connections from a web server. Many
- ; BSD-derived systems allow connections regardless of permissions. The owner
- ; and group can be specified either by name or by their numeric IDs.
- ; Default Values: user and group are set as the running user
- ; mode is set to 0660
- listen.owner = www-data
- listen.group = www-data
- ;listen.mode = 0660
- ; When POSIX Access Control Lists are supported you can set them using
- ; these options, value is a comma separated list of user/group names.
- ; When set, listen.owner and listen.group are ignored
- ;listen.acl_users =
- ;listen.acl_groups =
- ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
- ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
- ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
- ; must be separated by a comma. If this value is left blank, connections will be
- ; accepted from any ip address.
- ; Default Value: any
- ;listen.allowed_clients = 127.0.0.1
- ; Specify the nice(2) priority to apply to the pool processes (only if set)
- ; The value can vary from -19 (highest priority) to 20 (lower priority)
- ### /etc/nginx/conf.d/librenms.conf ###
- server {
- server_name nms.richesinengineering.net;
- root /opt/librenms/html;
- index index.php;
- charset utf-8;
- gzip on;
- gzip_types text/css application/javascript text/javascript application/x-javascript image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
- location / {
- try_files $uri $uri/ /index.php?$query_string;
- }
- location ~ [^/]\.php(/|$) {
- fastcgi_pass unix:/run/php-fpm-librenms.sock;
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- include fastcgi.conf;
- }
- location ~ /\.(?!well-known).* {
- deny all;
- }
- # Browsing to `http://yourlibrenms/smokeping/` should bring up the smokeping web interface
- location = /smokeping/ {
- fastcgi_intercept_errors on;
- fastcgi_param SCRIPT_FILENAME /usr/lib/cgi-bin/smokeping.cgi;
- fastcgi_param QUERY_STRING $query_string;
- fastcgi_param REQUEST_METHOD $request_method;
- fastcgi_param CONTENT_TYPE $content_type;
- fastcgi_param CONTENT_LENGTH $content_length;
- fastcgi_param REQUEST_URI $request_uri;
- fastcgi_param DOCUMENT_URI $document_uri;
- fastcgi_param DOCUMENT_ROOT $document_root;
- fastcgi_param SERVER_PROTOCOL $server_protocol;
- fastcgi_param GATEWAY_INTERFACE CGI/1.1;
- fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
- fastcgi_param REMOTE_ADDR $remote_addr;
- fastcgi_param REMOTE_PORT $remote_port;
- fastcgi_param SERVER_ADDR $server_addr;
- fastcgi_param SERVER_PORT $server_port;
- fastcgi_param SERVER_NAME $server_name;
- fastcgi_param HTTPS $https if_not_empty;
- fastcgi_pass unix:/var/run/fcgiwrap.socket;
- }
- location ^~ /smokeping/ {
- alias /usr/share/smokeping/www/;
- index smokeping.cgi;
- gzip off;
- }
- listen 443 ssl http2; # managed by Certbot
- ssl_certificate /etc/letsencrypt/live/nms.richesinengineering.net/fullchain.pem; # managed by Certbot
- ssl_certificate_key /etc/letsencrypt/live/nms.richesinengineering.net/privkey.pem; # managed by Certbot
- include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
- ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
- }
- server {
- if ($host = nms.richesinengineering.net) {
- return 301 https://$host$request_uri;
- } # managed by Certbot
- listen 80;
- server_name nms.richesinengineering.net;
- return 404; # managed by Certbot
- }
- root@nms:/etc/nginx/conf.d#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement