Inclusion Criteria:  Advanced unresectable or metastatic histologically or cytologically confirmed adenocarcinoma or squamous cell carcinoma of the stomach, gastroesophageal junction, or esophagus Measurable or evaluable disease defined by RECIST 1.1. Expansion cohorts only: Lesions amenable to research biopsy. This criteria can be waived by the PI after documented discussion with the treating physician.  Known HER2 status if histology is adenocarcinoma prior to enrollment; results from local CLIA laboratory is acceptable.  For Dose Escalation, patients are required to have documented HER2 negative cancer. For Dose Expansion, patients will be enrolled to either HER2 positive or negative cohorts at the time of enrollment  No prior systemic treatment for unresectable/advanced gastric, GEJ, or esophageal cancer.  Neoadjuvant or adjuvant systemic therapy is allowed; however, surgical resection should have been > 12 months from planned C1D1. Definitive chemoradiation is allowed if the last date of chemotherapy or radiation (whichever is more recent) is > 3 months from planned C1D1. Prior palliative radiation therapy, including brain radiation, in the unresectable setting is allowed, but the last treatment date should be >10 days from planned C1D1. At least 18 years of age ECOG performance status 0 or 1  Normal bone marrow and organ function as defined below:  Absolute neutrophil count ≥ 1,500/mcl Platelets ≥ 100,000/mcl Hemoglobin ≥ 9.0 g/dL Total bilirubin ≤ 1.5 x IULN AST(SGOT)/ALT(SGPT) ≤ 2.5 x IULN, unless there are liver metastases in which case AST and ALT ≤ 5.0 x IULN Creatinine ≤ 1.5 x IULN or creatinine clearance > 50 mL/min by Cockcroft-Gault Expansion Cohort B patients only: LVEF above LLN as assessed by MUGA or ECHO The effects of CA-4948 on the developing human fetus are unknown. For this reason, women of childbearing potential and men must agree to use adequate contraception (hormonal or barrier method of birth control, abstinence) prior to study entry and for the duration of study participation. Should a woman become pregnant or suspect she is pregnant while participating in this study, she must inform her treating physician immediately. Men treated or enrolled on this protocol must also agree to use adequate contraception prior to the study, for the duration of the study, and 3 months after completion of the study Ability to understand and willingness to sign an IRB approved written informed consent document (or that of legally authorized representative, if applicable).  Exclusion Criteria:  Current use or anticipated need for alternative, holistic, naturopathic, or botanical formulations used for the purpose of cancer treatment. Use of medical marijuana is permitted. A history of other malignancy with the exception of 1) malignancies for which all treatment was completed at least 2 years before registration and the patient has no evidence of disease; 2) or known indolent malignancies that do not require treatment and will likely not alter the course of treatment of metastatic gastric, GEJ, or esophageal cancer. History of allogeneic organ or stem cell transplant Currently receiving any other investigational therapeutic agents. Investigational tracers related to imaging studies are allowed with a 7 day-washout. Clinically active CNS metastasis; treated and asymptomatic metastasis allowed at the discretion of the PI. Radiotherapy to the brain must be completed > 10 days prior to planned C1D1. A history of allergic reactions attributed to compounds of similar chemical or biologic composition to CA-4948, FOLFOX, nivolumab, trastuzumab or other agents used in the study. Presence of interstitial lung disease that is symptomatic or may interfere with the detection or management of suspected treatment-related pulmonary toxicity QTc (Bazett) >470ms on screening EKG Gastrointestinal condition which could impair absorption of CA-4948 or inability to ingest CA-4948 Uncontrolled intercurrent illness including, but not limited to, ongoing or active infection, symptomatic congestive heart failure, unstable angina pectoris, or cardiac arrhythmia Pregnant and/or breastfeeding. Women of childbearing potential must have a negative pregnancy test within 7 days of study entry. Patients with HIV are eligible unless their CD4+ T-cell counts are < 350 cells/mcL or they have a history of AIDS-defining opportunistic infection within the 12 months prior to registration. Concurrent treatment with effective ART according to DHHS treatment guidelines is recommended. Recommend exclusion of specific ART agents based on predicted drug-drug interactions (i.e., for sensitive CYP3A4 substrates, concurrent strong CYP3A4 inhibitors (ritonavir and cobicistat) or inducers (efavirenz) should be contraindicated). Participants with active, known or suspected autoimmune disease. Participants with vitiligo, type I diabetes mellitus, residual hypothyroidism due to autoimmune condition only requiring hormone replacement, euthyroid participants with a history of Grave's disease (participants with suspected autoimmune thyroid disorders must be negative for thyroglobulin and thyroid peroxidase antibodies and thyroid stimulating immunoglobulin prior to first dose of study treatment), psoriasis not requiring systemic treatment, or conditions not expected to recur in the absence of an external trigger are permitted to enroll after discussing with the PI. Participants with a condition requiring systemic treatment with either corticosteroids (> 10 mg daily prednisone or equivalent) or other immunosuppressive medications within 14 days of study treatment except for adrenal replacement steroid doses > 10 mg daily prednisone equivalent in the absence of active autoimmune disease. Note: treatment with a short course of steroids (< 5 days) up to 7 days prior to initiating study treatment is permitted. Inhaled intranasal, intra-articular, and topical steroid uses are permitted.