Let $D$ be a ring which is infinite, not a field, and in which $D/I$ is finite for any nonzero ideal $I$ (what Pete Clark calls a abstract number ring). Then we can define $N(I) = |D/I|$ and write down a zeta function $$\zeta_D(s) = \sum_{I \neq 0} \frac{1}{N(I)^s}.$$
This specializes to the Riemann zeta function when $D = \mathbb{Z}$, to the Dedekind zeta function when $D = \mathcal{O}_K$, and to the zeta function of an affine algebraic curve over a finite field when $D$ is its ring of functions. If $D$ is Dedekind, then unique factorization of ideals gives an Euler product for this zeta function.
To get the zeta function of a curve, not necessarily affine, we replace ideals with effective divisors, that is, non-negative formal integer linear combinations $$\sum n_i P_i, n_i \ge 0$$
of points of $C$ over $\overline{\mathbb{F}_q}$ which are $\text{Gal}(\overline{\mathbb{F}_q}/\mathbb{F}_q)$-invariant, and the appropriate replacement for the norm here is $q^{\sum n_i}$. This reduces to the above description in the case of a (geometrically integral?) affine curve. (The more standard expression for the zeta function of a curve over a finite field, which tells you what the logarithm of the zeta function is in terms of counting points over finite extensions of $\mathbb{F}_q$, can be shown to be equivalent to this description using the exponential formula in combinatorics. See this blog post.)