nginx多站点,可多端口的配置
windows 配置多站点和linux 基本一致,只有路径表示不一致,如下图所示
erver {
listen 80;
server_name www.mydomain.com;
location / {
root D:/php_program;
index index.php index.html index.htm;
}
location ~ \.php$ {
root D:/php_program;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 80;
server_name www.mydomain1.com;
location / {
root D:/php_program1;
index index.php index.html index.htm;
}
location ~ \.php$ {
root D:/php_program1;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}