[英]iRedMail NginX config file update
Referring the guides Using iRedMail with NginX and Setting up iRedMail with NginX , I'd like to ask that in the server block 参考指南将iRedMail与NginX结合使用并设置iRedMail与NginX结合 ,我想在服务器块中问一下
server {
服务器{
listen 80;听80; server_name mail.mydomain.com;
server_name mail.mydomain.com;
location / {
rewrite ^ https://$server_name$1 permanent;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/share/apache2$fastcgi_script_name;
}
} }
I want to just remove the /usr/share/apache2 directory using 我只想使用以下命令删除/ usr / share / apache2目录
$ sudo apt-get remove apache2
or 要么
$ sudo rm -rf /usr/share/apache2
therefore in the NginX iRedMail config, can I replace the following line 因此,在NginX iRedMail配置中,我可以替换以下行吗?
fastcgi_param SCRIPT_FILENAME /usr/share/apache2$fastcgi_script_name;
with 与
fastcgi_param SCRIPT_FILENAME /usr/share/nginx$fastcgi_script_name;
or with 或搭配
fastcgi_param SCRIPT_FILENAME /etc/nginx$fastcgi_script_name; #I can see a file named fastcgi_params at /etc/nginx/
Secondly, I'd be interested in knowing how does the variable $fastcgi_script_name gets resolved? 其次,我想知道如何解析$ fastcgi_script_name变量?
I've figured out how the variable $fastcgi_script_name gets resolved. 我已经弄清楚了如何解析$ fastcgi_script_name变量。
According to my understanding, it basically replaces it with the value of $fastcgi_index, which in turn is index.php in the above case. 根据我的理解,它基本上将其替换为$ fastcgi_index的值,在上述情况下,该值又是index.php。 The recommended line is:
推荐的行是:
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
However, for that it needs to have the root variable defined either inside the location {} scope or the outer server {} scope. 但是,为此,需要在位置{}范围内或外部服务器{}范围内定义根变量。 Since, it is not defined in either of the above mentioned server block therefore for the time being I'm going to stick to:
由于它在上述任何一个服务器块中均未定义,因此暂时要坚持:
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.