2018-02-03 19:14:44 +00:00
|
|
|
|
2019-04-25 11:22:49 +00:00
|
|
|
set_real_ip_from 0.0.0.0/0;
|
|
|
|
real_ip_header X-Forwarded-For;
|
|
|
|
log_format upstreamlog
|
|
|
|
'[$time_local] $remote_addr -> $proxy_host:$upstream_addr '
|
|
|
|
'"$request" $status $body_bytes_sent '
|
|
|
|
'"$http_referer" "$http_user_agent"';
|
|
|
|
access_log /var/log/nginx/access.log upstreamlog;
|
|
|
|
|
2019-02-01 10:54:36 +00:00
|
|
|
upstream back {
|
2019-02-01 11:17:23 +00:00
|
|
|
server back_1:3000;
|
|
|
|
server back_2:3000;
|
2019-02-01 10:54:36 +00:00
|
|
|
}
|
2018-12-27 15:10:55 +00:00
|
|
|
server {
|
|
|
|
listen 80 default_server;
|
|
|
|
listen [::]:80 default_server;
|
|
|
|
server_name _;
|
|
|
|
autoindex off;
|
2019-07-11 15:22:42 +00:00
|
|
|
client_max_body_size 50M;
|
2018-02-03 19:14:44 +00:00
|
|
|
|
2019-02-01 10:46:54 +00:00
|
|
|
root /salix/dist;
|
2019-02-01 08:47:52 +00:00
|
|
|
error_page 404 = @notfound;
|
2018-02-03 19:14:44 +00:00
|
|
|
|
2019-02-01 10:06:23 +00:00
|
|
|
location @notfound {
|
2019-02-01 08:47:52 +00:00
|
|
|
return 302 /;
|
|
|
|
}
|
2019-01-26 13:22:59 +00:00
|
|
|
location ~ ^(/[a-zA-Z0-9_-]+)?/(?<path>api(/.*)?)$ {
|
2019-02-01 11:17:23 +00:00
|
|
|
proxy_pass http://back/$path$is_args$args;
|
2018-12-27 15:10:55 +00:00
|
|
|
}
|
2019-02-01 10:46:54 +00:00
|
|
|
location / {
|
2018-12-27 15:10:55 +00:00
|
|
|
autoindex on;
|
|
|
|
}
|
2018-02-03 19:14:44 +00:00
|
|
|
}
|