# $NetBSD: nginx.conf,v 1.1 2021/06/24 02:32:28 triaxx Exp $
#
# Configuration example fragment for www/nginx

location /dotclear/ {
    index index.php;
    alias /usr/pkg/share/dotclear/;
    access_log syslog:server=unix:/var/run/log,tag=dotclear;
    error_log syslog:server=unix:/var/run/log,tag=dotclear;

    location ~* /public(?:/(.*))?$ {
        alias /var/db/dotclear/public/$1;
    }

    location ~ \.php$ {
        try_files $uri =404;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $request_filename;
        fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_pass unix:/var/run/dotclear.sock;
        fastcgi_index index.php;
    }
}

# Example fragment for virtual hosting
#server {
#    listen 80;
#    listen [::]:80;
#    server_name dotclear.example.org;
#    index index.php;
#    root /usr/pkg/share/dotclear;
#    access_log syslog:server=unix:/var/run/log,tag=dotclear;
#    error_log syslog:server=unix:/var/run/log,tag=dotclear;
#
#    location ~* /public(?:/(.*))?$ {
#        alias /var/db/dotclear/public/$1;
#    }
#
#    location ~ \.php$ {
#        try_files $uri =404;
#        include fastcgi_params;
#        fastcgi_param SCRIPT_FILENAME $request_filename;
#        fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
#        fastcgi_param PATH_INFO $fastcgi_path_info;
#        fastcgi_pass unix:/var/run/dotclear.sock;
#        fastcgi_index index.php;
#    }
#}
