Mono FastCGI和Nginx索引文件优先级错误
我想在Nginx上设置Mono ASP.NET,但似乎索引优先级不起作用。 如果我使用下面的示例:Mono FastCGI和Nginx索引文件优先级错误,mono,indexing,nginx,fastcgi,Mono,Indexing,Nginx,Fastcgi,我想在Nginx上设置Mono ASP.NET,但似乎索引优先级不起作用。 如果我使用下面的示例: location / { root /srv/www/htdocs/; index index.htm index.html default.aspx Default.aspx; fastcgi_index Default.aspx; fastcgi_pass 127.0.0.1:9000; include
location / {
root /srv/www/htdocs/;
index index.htm index.html default.aspx Default.aspx;
fastcgi_index Default.aspx;
fastcgi_pass 127.0.0.1:9000;
include /etc/nginx/fastcgi_params;
}
location / {
root /srv/www/htdocs/;
index index.htm index.html default.aspx Default.aspx;
fastcgi_index /;
fastcgi_pass 127.0.0.1:9000;
include /etc/nginx/fastcgi_params;
}
location / {
root /srv/www/htdocs/;
index index.htm index.html default.aspx Default.aspx;
}
然后当我访问时,它总是请求Default.aspx
,如果没有这样的文件,web服务器将显示404错误
我试图通过搜索问题来找到答案,我发现了这个问题:
所以我想我遇到了同样的问题,然后我修改了配置文件如下:
location / {
root /srv/www/htdocs/;
index index.htm index.html default.aspx Default.aspx;
fastcgi_index Default.aspx;
fastcgi_pass 127.0.0.1:9000;
include /etc/nginx/fastcgi_params;
}
location / {
root /srv/www/htdocs/;
index index.htm index.html default.aspx Default.aspx;
fastcgi_index /;
fastcgi_pass 127.0.0.1:9000;
include /etc/nginx/fastcgi_params;
}
location / {
root /srv/www/htdocs/;
index index.htm index.html default.aspx Default.aspx;
}
web服务器仍然优先请求.aspx
-文件,即使我只有一个.aspx
文件,例如htdocs
文件夹中的random.aspx
,它仍然会在index.htm
之前显示它
然后当我删除所有与FastCGI相关的配置时,如下所示:
location / {
root /srv/www/htdocs/;
index index.htm index.html default.aspx Default.aspx;
fastcgi_index Default.aspx;
fastcgi_pass 127.0.0.1:9000;
include /etc/nginx/fastcgi_params;
}
location / {
root /srv/www/htdocs/;
index index.htm index.html default.aspx Default.aspx;
fastcgi_index /;
fastcgi_pass 127.0.0.1:9000;
include /etc/nginx/fastcgi_params;
}
location / {
root /srv/www/htdocs/;
index index.htm index.html default.aspx Default.aspx;
}
只有这样,索引优先级才能正常工作
那么谁能告诉我,为什么会这样?我是否必须修改任何与FastCGI相关的配置文件?确保monoserve中的FastCGI设置指向有效路径
fastcgi-mono-server2 /applications=www.domain1.xyz:/**:/var/www/www.domain1.xyz**/ /socket=tcp:127.0.0.1:9000
/var/www/www.domain1.xyz/必须指向web应用程序的根目录