Nginx:多个站点配置

qq_32932821 qq_32932821 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;
upstream nmxlnn {

#server 47.93.176.32:8183 weight=1 max_fails=3 fail_timeout=2 down;
server 39.105.84.32:80 weight=200 max_fails=3 fail_timeout=2;

}
server {
listen 8088;
server_name localhost;
root /usr/share/nginx/html/nmxln1;
index index.php index.html;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
if (!-e $request_filename) {
rewrite ^/index.php(.*)$ /index.php?s=$1 last;
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}

server {
listen 8089;
server_name localhost;
root /usr/share/nginx/html/nmxln2;
index index.php index.html;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
if (!-e $request_filename) {
rewrite ^/index.php(.*)$ /index.php?s=$1 last;
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}



server {
listen 80;
server_name localhost;
root /usr/share/nginx/html/nmxln;
index index.php index.html;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
if (!-e $request_filename) {
rewrite ^/index.php(.*)$ /index.php?s=$1 last;
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
}
...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部
qq_32932821
Framework 4,250 成员 4,522 内容