diff options
author | graysky | 2017-10-30 16:54:26 -0400 |
---|---|---|
committer | graysky | 2017-10-30 16:54:26 -0400 |
commit | 033d32553be8c531fe36a4f0a1645b096f0617e3 (patch) | |
tree | 73bbf8d5eb0a6d06307c55ca43646c3cfe2461b0 /nginx.pi-hole.conf | |
parent | 8415bdcec77b5699d9c8de0efad951b0b051cc0a (diff) | |
download | aur-033d32553be8c531fe36a4f0a1645b096f0617e3.tar.gz |
fix nginx redirect but lighttpd is still broken
Diffstat (limited to 'nginx.pi-hole.conf')
-rw-r--r-- | nginx.pi-hole.conf | 99 |
1 files changed, 36 insertions, 63 deletions
diff --git a/nginx.pi-hole.conf b/nginx.pi-hole.conf index 494c32c5ee71..f0098b41265b 100644 --- a/nginx.pi-hole.conf +++ b/nginx.pi-hole.conf @@ -1,67 +1,40 @@ -# place in /etc/nginx/conf.d/pihole.conf +# +# /etc/nginx/conf.d/pihole.conf +# +# https://github.com/pi-hole/pi-hole/wiki/Nginx-Configuration +# server { - listen 80; - listen [::]:80; - server_name pi.hole; - - root /srv/http/pihole; - index index.php; - - if ( $request_uri = / ) { - rewrite ^/$ $scheme://$host/admin/ permanent; - } - - location /admin { - try_files $uri $uri/ /index.php; - add_header X-Pi-hole "The Pi-hole Web interface is working!"; - add_header X-Frame-Options "DENY"; - } - - location ~ \.php$ { - include fastcgi.conf; - - fastcgi_param HTTP_HOST localhost; - fastcgi_param HTTP_ORIGIN localhost; - fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - } + listen 80 default_server; + listen [::]:80 default_server; + + root /srv/http/pihole; + server_name _; + autoindex off; + + index pihole/index.php index.php index.html index.htm; + + location / { + expires max; + try_files $uri $uri/ =404; + } + + location ~ \.php$ { + include fastcgi.conf; + fastcgi_pass 127.0.0.1:9000; + } + + location /*.js { + index pihole/index.js; + } + + location /admin { + root /srv/http/pihole; + index index.php index.html index.htm; + } + + location ~ /\.ht { + deny all; + } } -server { - listen 80 default_server; - listen [::]:80 default_server; - server_name _; - - root /srv/http/pihole; - index index.php; - - proxy_intercept_errors on; - error_page 404 /pihole/index.php; - - if ( $request_uri ~ ^(?!/pihole/)(?!/admin/).*\.js$ ) { - rewrite ^.*\.js$ $scheme://$host/pihole/index.js permanent; - } - - location / { - try_files $uri $uri/ /index.php; - add_header X-Pi-hole "A black hole for Internet advertisements"; - } - - location /admin { - try_files $uri $uri/ /index.php; - add_header X-Pi-hole "The Pi-hole Web interface is working!"; - add_header X-Frame-Options "DENY"; - } - - location ~ \.php$ { - include fastcgi.conf; - - fastcgi_intercept_errors on; - fastcgi_param HTTP_HOST localhost; - fastcgi_param HTTP_ORIGIN localhost; - fastcgi_param SERVER_NAME $host; - fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - } -} |