Apache 我需要翻译我的htaccess以便nginx工作
嗯,我在我的旧apache配置(htaccess)中重写了这个mod_,我正在尝试将配置设置为nginx,但我不能真正理解它在nginx中是如何工作的,我是所有nginx东西的新手,有人能帮我翻译一下吗。。。事先非常感谢你 当前htacces文件:Apache 我需要翻译我的htaccess以便nginx工作,apache,.htaccess,mod-rewrite,nginx,Apache,.htaccess,Mod Rewrite,Nginx,嗯,我在我的旧apache配置(htaccess)中重写了这个mod_,我正在尝试将配置设置为nginx,但我不能真正理解它在nginx中是如何工作的,我是所有nginx东西的新手,有人能帮我翻译一下吗。。。事先非常感谢你 当前htacces文件: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^(/static/)
RewriteRule . /app.php [L]
</IfModule>
server {
server_name test.url;
access_log /var/www/test.url/logs/access.log;
error_log /var/www/test.url/logs/error.log;
root /var/www/test.url/public_html/blank;
location / {
app.php;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/test.url/public_html/$
}
}
而不是:
location / {
app.php;
}
尝试:
非常感谢。你让我开心;)我开始明白这一点。只有一件事,你忘记了“;”在“try_文件”的结尾。。。
location /static/ {
# do nothing, we don't want to rewrite /static/
}
location / {
try_files $uri $uri/ /app.php
}