Using n8n with a hosts file modification

I’m currently working on a project for some data reporting and the site I’m pulling the data from is being moved to a different platform. My current issue is, I can’t perform data modification on the live server and want to do it on the newer platform, which I thought I could achieve with a temp URL, but that’s not the case. Is there anyway to force n8n to abide by a hosts file modification on my alma 8 box? It seems to not be following the rules I put in place for it, or is there a way to get n8n to give the IP address of the domain I’m giving it to run requests against the Moodle API?

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @Cypher,

n8n will follow what the hosts file says but if you are using Docker you will need to set the extra_hosts option in a similar way.

I’m not using docker, but now that you say it, it may be something with the environment variables in PM2, which is handling the instance.

Hey @Cypher,

PM2 can be more hassle than it is worth sometimes and I would strongly recommend user Docker as the image will use the version of Node we test against and won’t contain other npm packages on the system that could potentially cause issues.

Yeah, unfortunately the system I’m currently housed on doesn’t play nicely with docker, but it would probably be a good move in the future.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.