Custom Nginx Config


Just recently aware of v4, and I got lost in so many things.
I am aware that v4 is using Docker, and I have no experience prior to this so apologies for my lack of knowledge.

I usually use some custom config on my old /etc/nginx/sites-enabled/
But since there’s no /etc/nginx. where should I write this custom config now?

And how do I restart nginx, after I add the config?
Using service nginx restart as usual didn’t give my anything but error.


According to document, it’s in /opt/easyengine/sites/ After that I use docker ps to see the name or ID of’s nginx container. Then docker restart <ID>.

Not sure if this is only way because it’s too complicate. Too much change on ee4 haha.

1 Like

@sirmbhe You can place the custom configuration in /opt/easyengine/sites/ then use the site reload command to load the additional configuration that you want to add.


I just added my own nginx rule by doing the following.
For me it was not able to cd to /opt/easyengine/sites/ because the nginx directory is some kind of symlink between your own environment and the docker environment.
I had to sudo su to be able to cd into /opt/easyengine/sites/ (this probably isn’t the right way to do it because of the sudo su, can somebody please explain me how to cd properly?).

From /opt/easyengine/sites/ you can edit the user.conf file in the custom directory by doing the following nano nano custom/user.conf. You can add new rules directly to the file like this:

# Custom Nginx configuration can be put here

return 301 $scheme://;

Then I did site reload but that didn’t have any effect. I had to do a site restart

After doing this all was fine.

1 Like