| | 135 | `vi /etc/nginx/conf.d/librenms.conf` |
| | 136 | |
| | 137 | edit server_name as required: |
| | 138 | {{{#!bash |
| | 139 | server { |
| | 140 | listen 80; |
| | 141 | server_name librenms.example.com; |
| | 142 | root /opt/librenms/html; |
| | 143 | index index.php; |
| | 144 | |
| | 145 | charset utf-8; |
| | 146 | gzip on; |
| | 147 | 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; |
| | 148 | location / { |
| | 149 | try_files $uri $uri/ /index.php?$query_string; |
| | 150 | } |
| | 151 | location ~ [^/]\.php(/|$) { |
| | 152 | fastcgi_pass unix:/run/php-fpm-librenms.sock; |
| | 153 | fastcgi_split_path_info ^(.+\.php)(/.+)$; |
| | 154 | include fastcgi.conf; |
| | 155 | } |
| | 156 | location ~ /\.(?!well-known).* { |
| | 157 | deny all; |
| | 158 | } |
| | 159 | } |
| | 160 | }}} |