标签:eth module template location auto $2 负载均衡 com include
1.首先需要检查是否已经安装如下东西:
node 、nodemon 、yarn、nginx、redis。
如没有则按如下命令相应安装:
npm install n -g
npm install -g nodemon
npm install yarn -g
下载安装nginx,redis
2.将config文件拷贝至mobile-tm根目录下
3.在电脑项目所存的根目录下创建data/logs/mobile-tm文件夹
4.host中添加以下代码
127.0.0.1 qatm.iqdnet.com
127.0.0.1 devtm.iqdnet.com
5.在nginx文件夹中找到nginx.conf替换其中的文件内容
user root staff;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name front.qdingnet.com devfront.qdingnet.com qafront.qdingnet.com;
#access_log /var/log/nginx/access.log;
#error_log /var/log/nginx/error.log;
autoindex on;
add_header Access-Control-Allow-Origin ‘qdingnet.com‘;
location /public/ {
alias /Users/yong/qd/front/public/;
index index.html;
}
location /polymer/ {
alias /Users/yong/qd/front/polymer/;
index index.client.html index.html;
}
location /saas-web/ {
alias /Users/yong/qd/saas/;
}
location / {
rewrite ^/([\w-]+)/(.*)$ /$1/temp/$2 break;
root /Users/yong/qd/front/;
}
}
server {
listen 80;
server_name m2.iqdnet.com qam.iqdnet.com devm.iqdnet.com;
access_log /data/logs/devm-access.log;
error_log /data/logs/devm-error.log;
add_header Access-Control-Allow-origin *;
add_header Access-Control-Allow-Methods ‘GET, POST‘;
location / {
proxy_pass http://127.0.0.1:9000;
}
}
server {
listen 80;
server_name qatm.iqdnet.com devtm.iqdnet.com;
location / {
proxy_pass http://127.0.0.1:9001;
}
}
server {
listen 80;
server_name qafm.iqdnet.com;
location / {
proxy_pass http://127.0.0.1:9002;
}
}
server {
listen 80;
server_name devb.qdingnet.com;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location / {
proxy_pass http://127.0.0.1:9003;
}
}
server {
listen 80;
server_name bigdata.qdingnet.com;
location / {
proxy_pass http://127.0.0.1:3000;
}
}
}
标签:eth module template location auto $2 负载均衡 com include
原文地址:https://www.cnblogs.com/longflag/p/12186475.html