Nginx config for mastodon doesn't work on local

I’m trying to run a mastodon instance on my home Ubuntu 20.04 server. So, I followed all the steps in the joinmastodon for installation.

In the end I got a nginx config for Mastodon in /etc/nginx/sites-enabled/mastodon.

I decided to test the website locally, so I replaced the 2 parameters of server_name with Also I commented out listen 443 ssl http2;
and listen [::]:443 ssl http2;.

Then I wrote in bash nginx -s reload, and got these erros

nginx: [warn] conflicting server name "" on, ignored nginx: [error] open() "/run/" failed (2: No such file or directory)

You can find the full config here.

Is there a way I can run Mastodon locally on my computer with nginx? Any help is appreciated.

server_name parameter is used to route HTTP requests to “named” virtual hosts, so either it needs to be a hostname, or if this is the only one - just leave it out.

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