server { listen 7008; server_name 127.0.0.1; location /user { proxy_pass http://127.0.0.1:7003; } location / { root C:/aa; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }
nginx 裏面相應的設置 ,監聽7008端口,當訪問/時,加載對應前臺頁面,訪問/user時,從後臺獲取數據html