Hermetia illucens individuals were reared at the entomological facilities of the University of Milan (45°28'33.9N, 9°13'39.9E). The Black Soldier Flies (BSFs) used in this work originated from a laboratory stock culture of H. illucens that was retrieved from a compost container in Lombardy, Northern Italy (45°19ʹ54ʺN, 9°05ʹ58ʺE); refer to Jucker et al., 2017, doi:10.1093/ee/nvx154. Insects were reared on three different diets: a full nutrient (FN) diet, composed by 50% wheat germ, 30% alfalfa, and 20% corn flour, to which an equal volume of water was added; a nutrient restriction fruit (NRF) diet formed by mixing fresh apples, pears and oranges (33.3% each); and a nutrient restriction vegetable (NRV) diet composed by fresh green beans, cabbage and lettuce (33% each). In the laboratory, the BSF eggs were transferred into plastic containers (10.5 × 5 cm), with metal mesh to allow air exchange. To each of the containers one of the diets (FN, NRF or NRV) was added for a total of 3 containers per diet. These containers were kept in a climate chamber under controlled conditions (temperature: 25°C ± 0.5°C; relative humidity: 60% ± 5%; photoperiod: 12:12 light:dark). The larvae were provided ad libitum access to the three diets. To determine physicochemical conditions of four gut comportments (crop, midgut, hindgut and rectum) the gut was extracted from the larvae. Oxygen (µmol/l), pH and redox potential (mV) were measured by using an oxygen microsensor (OX-50) with a tip diameter of 50 µm, a pH microelectrode (PH-50) with a tip diameter of 50 µm and a redox microelectrode (RD-50) with a tip diameter of 50 µm, respectively, from Unisense (Aarhus, Denmark).