I am moving from an Apache to an NGINX environment and need to convert the following virtual server configuration to NGINX.
<VirtualHost *:80>
DocumentRoot /var/www/myproject/web
ServerName myproject.dev
ServerAlias myproject.dev
<Directory /var/www/myproject/web>
AllowOverride All
Order allow,deny
Allow from All
</Directory>
</VirtualHost>
What would be the "exact translation" of this to NGINX?
Since Nginx does not have an equivalent to the . htaccess file (i.e. no directory level configuration files), you need to update the main configuration and reload nginx for any changes to take effect.
By default, the configuration file is named nginx. conf and placed in the directory /usr/local/nginx/conf , /etc/nginx , or /usr/local/etc/nginx .
server {
listen 80;
server_name myproject.dev;
root /var/www/myproject/web;
}
Start from here http://wiki.nginx.org/Configuration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With