Nginx:多个站点配置

qq_32932821 2018-07-26 06:16:57
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;
}
}
}
...全文
622 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
多站点配置 , 可以一个端口 , 多个配置文件
JoeBlackzqq 2018-09-04
  • 打赏
  • 举报
回复
现在的表现是啥,把问题说清楚了呀!

4,250

社区成员

发帖
与我相关
我的任务
社区描述
国内外优秀PHP框架讨论学习
社区管理员
  • Framework
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧