Commit cd9308bc by maxingyu

nginx

parent db43c9f0
server { server {
listen 80; listen 80;
server_name agent.sosocar.test;
root /workspace/gulp/layui-agent/start;
access_log /var/log/nginx/agent.sosocar.local.access.log;
error_log /var/log/nginx/agent.sosocar.local.error.log;
index index.html index.htm;
location /src/ {
alias //workspace/gulp/layui-agent/src/;
}
location /dist/ {
alias //workspace/gulp/layui-agent/dist/;
}
location /master/ {
proxy_pass http://dealer.test;
}
}
server {
listen 80;
server_name piston.test; server_name piston.test;
location / { location / {
...@@ -69,3 +47,124 @@ server { ...@@ -69,3 +47,124 @@ server {
deny all; deny all;
} }
} }
server {
listen 80;
server_name vue.dealer.test;
root /workspace/vue/dealer/dist;
index index.html;
access_log /var/log/nginx/vue.dealer.access.log;
error_log /var/log/nginx/vue.dealer.error.log;
set $flag 0;
if ($remote_addr !~ "113.233.134.130|122.70.153.156|122.70.153.157|60.17.6.59|36.112.66.147i|36.112.66.148") {
set $flag "${flag}1";
}
if ($request_uri !~* ^(/wh.html|/static/images/carsdaq_wh.png)$) {
set $flag "${flag}2";
}
#if ($flag = "012") {
# rewrite ^(.*) /wh.html redirect;
#}
if ($request_uri ~* ^(/wh.html)$) {
rewrite ^(.*) / redirect;
}
location ~* ^.+.(jpg|jpeg|gif|png) {
if (!-e $request_filename) {
proxy_pass http://dealer.test;
}
}
location / {
try_files $uri /index.html?$query_string;
}
location /static {
gzip_static on;
}
location /api {
rewrite /api/(.*) /dealer/$1 break;
proxy_pass http://dealer.test;
}
}
server {
listen 80;
listen 443;
server_name layui.test;
root /workspace/vue/layui-agent/start;
#root /data/git/piston/dist;
index index.html index.htm;
access_log /var/log/nginx/layui-agent.access.log;
error_log /var/log/nginx/layui-agent.error.log;
location ~* ^/(?!dist).+.(jpg|jpeg|gif|png) {
if (!-e $request_filename) {
proxy_pass http://sosocar.test;
}
}
location /src/ {
alias /workspace/vue/layui-agent/src/;
}
location /dist/ {
alias /workspace/vue/layui-agent/dist/;
}
location /master/ {
proxy_pass http://dealer.test;
}
}
server {
listen 80;
server_name promotion.build.test;
root /workspace/vue/promotion/dist;
index index.html;
access_log /var/log/nginx/promotion.build.access.log;
error_log /var/log/nginx/promotion.build.error.log;
location / {
try_files $uri /index.html?$query_string;
}
}
server {
listen 80;
listen 443;
server_name provider.test;
root /workspace/vue/layui-provider/start;
#root /data/git/piston/dist;
index index.html index.htm;
access_log /var/log/nginx/layui-agent.access.log;
error_log /var/log/nginx/layui-agent.error.log;
location ~* ^/(?!dist).+.(jpg|jpeg|gif|png) {
if (!-e $request_filename) {
proxy_pass http://sosocar.test;
}
}
location /src/ {
alias /workspace/vue/layui-provider/src/;
}
location /dist/ {
alias /workspace/vue/layui-provider/dist/;
}
location /provider/ {
proxy_pass http://sosocar.test;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment