nginx couple of issues (bug?) and Magento configuration

Okay so I decided I wanted to give nginx a try on a clone of my Magento website, more than anything to satisfy my curiosity. I followed the instructions on the virtualmin website: everything went well.

Problem 1:
I can start and stop the nginx service from a shell, but in virtualmin I get "Failed to start Nginx : sh: /etc/init.d/nginx: No such file or directory "
When I start the service manually, then go into virtualmin and press "Apply Nginx Configuration, same error: "Failed to apply Nginx configuration : sh: /etc/init.d/nginx: No such file or directory "

I tried a suggested configuration from but it wont allow me to stop, start, restart the service (access denied) and I removed the file immediately.

Problem 2:
I got the site running, but every time I click on a link, it says the page cannot be displayed. Probably because .htaccess is no longer used. I came across this for configuring Magento and Nginx:

Now purely looking at the Magento portion of Nginx, it wants me to create a config file in nano /etc/nginx/conf.d/magentodomain.conf but when I did this, I couldn’t start the service. I noticed that virtualmin includes the virtual site information, but dont know how to integrate or if its safe to remove from nginx.conf and put it in magentodomain.conf as the article suggests?

Any thoughts or suggestions, I would really like to give this a try :slight_smile:



EDIT: Okay so I went a head and removed the configuration information for my website in nginx.conf, created a mysite.conf and put in the information from the default file, restarted service and it worked! Went line by line for the suggested configuration of magento and found some conflicting configuration and now thats working too.

So for problem 2, I’m good and will leave this for others, but I’m still scratching my head on problem 1 :slight_smile: