# local-path: /usr/local/etc/nginx/servers/.

# web
location ~ ^/web/ {
    root   /Users/malk/server/java-mcli/mjava/src/test/resources/nginx/html/;
    index  index.html index.htm;
}

# mjs
location ~ ^/mjs/ {
    root   /home/mc;
    index  index.html index.htm;
}

# proxy
location ~ ^/frp/ {
    rewrite  ^/frp/(.*)$  /api/$1  break;
    proxy_pass http://127.0.0.1:1003;
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Remote_Addr $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Referer $http_referer;
    client_max_body_size 100m;
    client_body_buffer_size 20480k;
    proxy_send_timeout 300s;
    proxy_read_timeout 300s;
}

error_page   404 /404.html;
error_page   500 502 503 504  /50x.html;

# prod
location ~ ^/api/ {
    #rewrite  ^/mc/(.*)$  /$1  break;
    proxy_pass http://127.0.0.1:9001;
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Remote_Addr $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Referer $http_referer;
    client_max_body_size 100m;
    client_body_buffer_size 20480k;
    proxy_send_timeout 300s;
    proxy_read_timeout 300s;
}

# test
location ~ ^/test/ {
    #rewrite  ^/mc/(.*)$  /$1  break;
    proxy_pass http://127.0.0.1:9002;
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Remote_Addr $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Referer $http_referer;
    client_max_body_size 100m;
    client_body_buffer_size 20480k;
    proxy_send_timeout 300s;
    proxy_read_timeout 300s;
}

# dev
location ~ ^/dev/ {
    #rewrite  ^/mc/(.*)$  /$1  break;
    proxy_pass http://127.0.0.1:9003;
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Remote_Addr $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Referer $http_referer;
    client_max_body_size 100m;
    client_body_buffer_size 20480k;
    proxy_send_timeout 300s;
    proxy_read_timeout 300s;
}