How to make mattermost listen on localhost

Hello everyone,

my mattermost server works nicely and the instructions in the installation guide were very well written and clear. Thanks to whoever put in the effort to write that document :slight_smile:

One things is still unclear to me unfortunately. In section Configuring NGINX as a proxy for Mattermost Server it is suggested to configure the proxy setup for nginx in the following way:

upstream backend {
   server 10.10.10.2:8065;
   keepalive 32;
}

with the IP of course replaced with the IP of one’s own server. However, I wondered if it wouldn’t be smarter to use localhost instead of the IP, if both nginx and mattermost run on the same machine. I mean mattermost really shouldn’t use the NIC instead of the loopback device and I wondered if it does use the NIC if I enter the IP instead of localhost here.

@paulrothrock Would support team be familiar with this?

Hi @max0815

Yes, if Mattermost and Nginx are running on the same server then you’d use 127.0.0.1 instead of the NIC IP address.

1 Like

Thx for the kind answer, wasn’t really sure if that would make a difference. Anyway, if someone wonders about the same thing:

If nginx and mattermost run on the same server you can replace in the code snippet above server 10.10.10.2:8065; with server 127.0.0.1:8065;.