Nginx:多个站点配置
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;
}
}
}
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;
}
}
}
...全文
相关推荐
Nginx一个IP如何配置多个站点的方法教程
前言 对于Nginx,一个IP上配置多个站点还是很常见的。尤其是在开发环境上,更是如此。 下面在我的阿里云上简单的实现这样一个需求: 在一个IP上通过对端口区分来配置多个站点。 环境初始化目录一览配置站点准备添加配置文件疑难杂项fastcgi_passNginxphp-fpm的进程间通信有两种方式总结 环境 手头上正好有一台阿里云学生机,趁着没过期,就拿来用吧。 操作系统:centOS7 php-fpm Nginx 初始化 在centos上搭建php-fpm+nginx环境不是很难,网上有很多的帖子,按照上面讲解的,把需要安装的软件安装一下就行了。 目录一览 安装完毕后,配置文件通
Nginx 配置多站点vhost 的方法
主要介绍了Nginx 配置多站点vhost 的方法,需要的朋友可以参考下
Nginx 的多站点配置方案
主要介绍了Nginx 的多站点配置方案,需要的朋友可以参考下
nginx添加站点脚本
nginx添加站点脚本
详解Nginx配置多站点需要踩的坑
本篇文章主要介绍了详解Nginx配置多站点需要踩的坑,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧


Framework
