# Propagator in string theory and boundary conditions

I would like to understand how to compute propagators for open and closed strings.
My references are Tong's lecture notes, https://arxiv.org/abs/0908.0333 and Blumenhagen, Lust, Theisen book "Basic Concepts of String Theory".

Tong uses a path integral approach: he starts from \begin{align} 0=\int\ \mathcal D X\ \frac{\delta}{\delta X(\sigma)}(e^{-S}X(\sigma'))\implies \langle \partial^2X(\sigma)X(\sigma')\rangle=-2\pi\alpha'\delta(\sigma-\sigma'), \end{align} which he solves by noticing that $$\partial^2 {\rm ln }(\sigma-\sigma')^2=4\pi\delta(\sigma-\sigma')\implies\langle X(\sigma)X(\sigma')\rangle=-\frac{\alpha'}{2}{\rm ln}(\sigma-\sigma')^2.$$ In this solution, he doesn't seem to be concerned with any boundary condition: therefore, this seems to be valid for both open and closed strings.

On the contrary, in the mentioned book, there are different expressions for this propagator, depending on the case (closed string, open string with NN, DD, DN, ND conditions). See pages 37, 38, 97, 98.

How are these computations performed?