Endoplasmic reticulum (ER) alpha-glucosidase inhibitors, which block the trimming step of N-linked glycosylation, have been shown to eliminate the production of several ER-budding viruses. Here we investigated the effects of one such inhibitor, N-nonyl-deoxynojirimycin (NN-DNJ), a 9-carbon alkyl iminosugar derivative, on infection by Japanese encephalitis virus (JEV) and dengue virus serotype 2 (DEN-2). In the presence of NN-DNJ, JEV and DEN-2 infections were suppressed in a dose-dependent manner. This inhibitory effect appeared to influence DEN-2 infection more than JEV infection, since lower concentrations of NN-DNJ substantially blocked DEN-2 replication. Secretion of the flaviviral glycoproteins E and NS1 was greatly reduced, and levels of DEN-2 viral RNA replication measured by fluorogenic reverse transcription-PCR were also decreased, by NN-DNJ. Notably, the viral glycoproteins, prM, E, and NS1 were found to associate transiently with the ER chaperone calnexin, and this interaction was affected by NN-DNJ, suggesting a potential role of calnexin in the folding of flaviviral glycoproteins. Additionally, in a mouse model of lethal challenge by JEV infection, oral delivery of NN-DNJ reduced the mortality rate. These findings show that NN-DNJ has an antiviral effect on flavivirus infection, likely through interference with virus replication at the posttranslational modification level, occurring mainly in the ER.