我正在尝试改善某些开源软件的安装文档,但是我遇到了Web服务器配置的障碍。我已经将此软件与Apache配合使用,但是为了保持一致性,我需要在文档中使用Nginx。使用这种Apache配置,如何在Nginx中获得相同的结果?
<VirtualHost *:80>
ServerName example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/publisher/public
<Directory /var/www/publisher/public>
AllowOverride None
Order Allow,Deny
Allow from All
Header set access-control-allow-origin http://example2.com
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>