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?
 A: There is no an algorithmic way to solve the Poisson equation in two dimensions (except in the case of a disk). The problem you want to address must be done in a case by case manner.
The whole chapter six in Polchinski string theory texbook (page 170,Vol. 1) is dedicated to find scalar Green functions for wolrdsheets of different topology (boundary conditions for Poisson equation). The step-by-step procedure can be found in section 6.2.
Extra comments:

*

*A hint to derive the particular expression you wrote: Solve equation 6.2.8 in Polchinski (the solution is equation 6.2.9) using the answer to the following PSE question How to derive Eq. (2.1.24) in Polchinski's string theory book or solve the exercise 2.1.


*See Polchinski's String theory Green's function on $RP_2$; eq. (6.2.38) p. 176 for the particular derivation of the scalar propagator in the case of the two dimensional projective plane.


*Your question was asked in PSE before, see Deriving the reduced Green's functions in Polchinski's volume 1.
