Skip to main content

Nginx Configuration

add powerdns-admin.conf

Input:

cat << EOF > /etc/nginx/sites-enabled/powerdns-admin.conf
server {
listen *:80;
server_name pdns-admin.paha.my.id www.pdns-admin.paha.my.id;

index index.html index.htm index.php;
root /opt/web/powerdns-admin;
access_log /var/log/nginx/powerdns-admin.local.access.log combined;
error_log /var/log/nginx/powerdns-admin.local.error.log;

client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_redirect off;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;
proxy_buffer_size 8k;
proxy_set_header Host \$host;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
proxy_headers_hash_bucket_size 64;

location ~ ^/static/ {
include /etc/nginx/mime.types;
root /opt/web/powerdns-admin/powerdnsadmin;

location ~* \.(jpg|jpeg|png|gif)\$ {
expires 365d;
}

location ~* ^.+.(css|js)\$ {
expires 7d;
}
}

location / {
proxy_pass http://unix:/run/powerdns-admin/socket;
proxy_read_timeout 120;
proxy_connect_timeout 120;
proxy_redirect off;
}
}

EOF

Enable and start services

Input:

systemctl enable --now nginx