server { listen 8080; server_name localhost; location / { proxy_pass http://192.168.9.163:8899; } location /api/ { rewrite ^/api/(.*)$ /$1 break; proxy_pass http://192.168.9.163:8888; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-real-ip $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }