1
0
Fork 0
mirror of https://github.com/fernwerker/ownDynDNS.git synced 2025-07-10 14:15:14 +02:00

added example nginx server block

This commit is contained in:
Nils Blume 2023-08-22 14:42:13 +02:00
parent 9107b3fc84
commit d2d5361816

View file

@ -0,0 +1,54 @@
#
# This assumes you already have the html { block configured
#
server {
listen 80; # highly recommend to use 443 and ssl, look into using certbot
server_name dyndns.example.com;
root /var/www/dnydns.example.com;
# if you are using a dedicated site remove everythin except update.php
# update.php;
update.php index index.html index.htm index.nginx-debian.html index.php;
# deny all access to any file containing "env", "log" or "json"
# returns 404 as if file did not exist
location ~* (env|log|json) {
deny all;
return 404;
}
# deny access to any file .ht* like .htaccess or .htpasswd
location ~ /\.ht {
deny all;
}
# pass PHP scripts to FastCGI server
location ~ \.php$ {
# FastCGI config, might be in another file that is included
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;
# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_index index.php;
include fastcgi.conf;
# With php-fpm (or other unix sockets):
fastcgi_pass unix:/run/php/php-fpm.sock;
# With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}
}