The premise of "Ode to a Nightingale" is pretty straightforward: the poet hears the beautiful song of the bird at dusk, and the sound causes him to reflect on his own mortality, and the bonds of everyday life. The essential problem of the poem is the poet's lack of access to the eternal world of beauty to which the nightingale's song belongs -- in a sense, the poem, beautiful as it is, is about the inadequacy of poetry to express the eternal beauty the poet perceives in the world.
We've seen this in other Keats poems; in "Ode on a Grecian Urn," for example, the figures on the urn are idealized and fixed; their beauty is eternal, while the poet is all too aware of the fleeting nature of his perception. Similarly, the song of the nightingale is eternal; Keats writes "Thou wast not born for death, immortal Bird! / No hungry generations tread thee down; / The voice I hear this passing night was heard / In ancient days by emperor and clown." The enduring nature of the bird's beauty is contrasted with the mortality of men: "Here, where men sit and hear each other groan; / Where palsy shakes a few, sad, last gray hairs, / Where youth grows pale, and spectre-thin, and dies."
The "here" refers to the "real" world in which the poet must live; the "ideal" world of the bird, which can be understood as the eternal world of beauty, is what the poet longs to reach. He imagines a wine that can take him there: "O for a beaker full of the warm South, / Full of the true, the blushful Hippocrene, / With beaded bubbles winking at the brim, / And purple-stained mouth; / That I might drink, and leave the world unseen, / And with thee fade away into the forest dim."
Of course, wine is no use. Neither is poetry: "Away! away! for I will fly to thee, / Not charioted by Bacchus and his pards, / But on the viewless wings of Poesy, / Though the dull brain perplexes and retards." Keat's "dull brain" is unequal to the task of capturing or understanding the beauty of the nightingale's song. He next turns to death as a possible way to the ideal world of beauty: "Now more than ever seems it rich to die, / To cease upon the midnight with no pain, / While thou art pouring forth thy soul abroad In such an ecstasy! / Still wouldst thou sing, and I have ears in vain— / To thy high requiem become a sod." The poet recognizes that even if he were to die, he would still be separate from the beauty of the nightingale -- he would be dead and unhearing, while the bird's beautiful song would endure.
The poem ends when the bird flies away. The reverie of the poet is broken:
Adieu! adieu! thy plaintive anthem fades
Past the near meadows, over the still stream,
Up the hill-side; and now 'tis buried deep
In the next valley-glades:
Was it a vision, or a waking dream?
Fled is that music:—Do I wake or sleep?
His final question -- is he asleep or awake? -- reframes this problem of the poem. One way to think about the last question is to see it as a question about the nature of poetry itself: is this poem a dream -- is it a vision of ideal beauty, or of the harsh limits of reality and poetic language? The fact that the poem ends with no definite answer to this question suggests that the ideal and the real, for Keats, are perhaps not opposites at all, but two realities that poetry can only imperfectly describe.