如何将Apache配置转换为NGINX

Pet*_*ter 6 apache nginx

我正在从Apache迁移到NGINX环境,需要将以下虚拟服务器配置转换为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>
Run Code Online (Sandbox Code Playgroud)

这对NGINX的"确切翻译"是什么?

Ale*_*Ten 6

server {
    listen 80;
    server_name myproject.dev;
    root /var/www/myproject/web;
}
Run Code Online (Sandbox Code Playgroud)

从这里开始http://wiki.nginx.org/Configuration.


小智 5

也许这会有所帮助,只需结帐并尝试;)

https://github.com/nhnc-nginx/apache2nginx