Report this

What is the reason for this report?

Nginx config file for a website in FreeBsd and Linux are quite different?

Posted on April 29, 2017

I know how to setup nginx in Linux. In FreeBsd I thought it’d exactly the same, except maybe a location of the config file. In Linux it’s /etc/nginx/sites-available/default, in FreeBsd /usr/local/etc/nginx/nginx.conf

However, according to a tutorial here, in FreeBsd the config is also quite different: in Linux I’d have 2 sections of “server” for http and https. In FreeBsd there has to be “user” on the top level and number of workers. In other things which are pretty different. Not just paths, but the structure and sections.

Is that really so and they’re indeed different?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @samoshi Like @CrypticDesigns says, the configuration is not different, but you’re referencing two different config files. On most Linux, the main Nginx config is /etc/nginx/nginx.conf. On most BSD it’s /usr/local/etc/nginx/nginx.conf. I don’t have access to a BSD right now, but on Linux the server block configuration is located in /etc/nginx/sites-enabled/ (which is normally a symlink to /etc/nginx/sites-available/. My guess would be that BSD has the same setup, so that would be /usr/local/etc/nginx/sites-enabled.

@hansen thx. On Linux I use " /etc/nginx/sites-available/default" for the config of my website, what is it on FreeBsd?

oh, wait, I’ll check if it’s “/usr/local/etc/nginx/sites-enabled/default” later.

@hansen I haven’t changed it after installation, it’s the default one.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.