Home  Main Website     Git     Matrix     Searx    

PwOSS - Wiki

Changes in 676db96: added new nginx config (pi-hole)
content/server/arch-server-docu.md
... ...
@@ -1612,31 +1612,52 @@ ctrl + x
1612 1612
yes
1613 1613
1614 1614
```
1615
-sudo cp /usr/share/pihole/configs/nginx.example.conf /etc/nginx/sites-available/pihole && sudo nano /etc/nginx/sites-available/pihole
1615
+sudo nano /etc/nginx/sites-available/pihole
1616 1616
```
1617
-and change:
1618
-
1617
+Change the IP (server_name)
1619 1618
```
1620
-listen 80 default_server;
1621
- listen [::]:80 default_server;
1622
-server_name _;
1623
-```
1624
-to
1619
+server {
1620
+ listen 987 default_server;
1621
+ listen [::]:987 default_server;
1625 1622
1626
-```
1627
-listen 987 default_server;
1628
- listen [::]:987 default_server;
1629
-server_name 192.168.1.76; # Your server IP address
1630
-```
1631
-and change:
1623
+ root /srv/http/pihole;
1624
+ server_name 192.168.1.141;
1632 1625
1633
-```
1634
- fastcgi_pass 127.0.0.1:9000;
1635
-```
1636
-to
1626
+ autoindex off;
1627
+
1628
+ index pihole/index.php index.php index.html index.htm;
1637 1629
1638
-```
1639
- fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
1630
+ location / {
1631
+ expires max;
1632
+ try_files $uri $uri/ =404;
1633
+ }
1634
+
1635
+ location ~ \.php$ {
1636
+ include fastcgi_params;
1637
+ fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
1638
+ fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
1639
+ fastcgi_param FQDN true;
1640
+# auth_basic "Restricted"; # For Basic Auth
1641
+# auth_basic_user_file /etc/nginx/.htpasswd; # For Basic Auth
1642
+ }
1643
+
1644
+ location /*.js {
1645
+ index pihole/index.js;
1646
+# auth_basic "Restricted"; # For Basic Auth
1647
+# auth_basic_user_file /etc/nginx/.htpasswd; # For Basic Auth
1648
+ }
1649
+
1650
+ location /admin {
1651
+ root /srv/http/pihole;
1652
+ index index.php index.html index.htm;
1653
+# auth_basic "Restricted"; # For Basic Auth
1654
+# auth_basic_user_file /etc/nginx/.htpasswd; # For Basic Auth
1655
+ }
1656
+
1657
+ location ~ /\.ht {
1658
+ deny all;
1659
+ }
1660
+}
1640 1661
```
1641 1662
ctrl + x
1642 1663
yes