We present the results of imaging photometric and long-slit spectroscopic observations of comet 2P/Encke performed at the heliocentric distance 0.56 au, geocentric distance 0.65 au, and phase angle 109.2 deg on November 4, 2013 and at 1.05 au, 1.34 au, and 46.8 deg on January 23, 2017. Observations were carried out at the 6-m BTA telescope of the Special Astrophysical Observatory (Russia) with the multimode focal reducer SCORPIO-2. In 2013, the direct images of comet Encke were obtained with the broad-band V filters, whereas in 2017 the narrow-band cometary BC, RC, and NH2 filters as well as the medium-band SED500 and broad-band r-sdss filters were used for observations. About 60 emissions belonging to the CN, C2, C3, NH2, CH, and CO+ molecules were identified within the range 3750-7100 {AA}. The ratios of the production rates C2/CN and C3/CN correspond to the typical comets, not depleted in the carbon-chain. A complex structure of the coma was detected in both observational periods. In January 2017, the dust was in general concentrated near the nucleus, the dust/gas ratio was 2.9 in the r-sdss filter, however, this ratio was larger than 1 at distances 3000-40000 km from the nucleus. We found that about 75% of the flux of the reflected light in the central pixel was due to the nucleus, whereas the nucleuss flux contributed 48% in the total intensity of the 2000 km area of the coma. We found that after correction for the dust coma contamination the nucleus magnitude is 18.8m+/-0.2m.