- #server {
- # listen 80;
- # server_name web01.lathwood.uk;
- # return 301 https://$host$request_uri;
- #}
- server {
- listen 443 ssl http2;
- server_name web01.lathwood.uk;
- root /opt/librenms/html;
- index index.php;
- ssl_certificate /etc/letsencrypt/live/web01.lathwood.uk/cert.pem;
- ssl_certificate_key /etc/letsencrypt/live/web01.lathwood.uk/privkey.pem;
- access_log /opt/librenms/logs/access_log;
- error_log /opt/librenms/logs/error_log;
- gzip on;
- gzip_types text/css application/javascript text/javascript pplication/x-javascript text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
- location / {
- try_files $uri $uri/ @librenms;
- # auth_basic "Restricted";
- # auth_basic_user_file /etc/nginx/.htpasswd;
- }
- location ~ \.php {
- include fastcgi.conf;
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- fastcgi_pass 127.0.0.1:9000;
- }
- location ~ /\.ht {
- deny all;
- }
- location @librenms {
- rewrite api/v0(.*)$ /api_v0.php/$1 last;
- rewrite ^(.+)$ /index.php/$1 last;
- }
- }