We are developing with front React and backend Rails.
The front is up to cloudfront, s3, and the backend is deployed with ce2, but Ajax communication does not go well.

In environment variables
REACT_APP_DEV_API_URL = "http: // ce2 Public IP /"

export default axios.create ({{
baseURL: process.env.REACT_APP_DEV_API_URL

const getArticles = async () =>{
try {
const results = await json.get ('/ articles')
setArticles (results.data)
} catch (error) {
console.log (error)

I try to hit the API like this, and in the development environment I can hit/ce2 public IP/articles, but in S3 it becomes localhost/articles.

I would appreciate it if anyone could understand.