1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| upstream server-api{ server 127.0.0.1:3110; } upstream server-resource{ server 127.0.0.1:3120; } server { listen 3111; server_name localhost; root /home/www/server-statics; location ^~/api/ { rewrite ^/(.*)$ /$1 break; proxy_pass http://server-api; } location ^~/captcha { rewrite ^/(.*)$ /$1 break; proxy_pass http://server-api; } location ^~/img/ { rewrite ^/(.*)$ /$1 break; proxy_pass http://server-resource; } location / { try_files $uri $uri/ /index.html =404; } }
|