所以我使用browserHistory創建一個反應網站,我現在的Nginx設置爲所有網址提供index.html,但是我已經分離出我的網站的管理部分,所以我需要任何/ admin下的url到服務器admin.html,但我可以;弄清楚(不是服務器人!)。Nginx重寫2個HTML頁面的React應用程序
這是我目前的配置,任何幫助將不勝感激!
server { listen 80; server_name http://178.62.98.191/; root /www/rawnet-one-web/dist; index index.html index.htm; rewrite ^/(.*)/$ $1 permanent; location/{ auth_basic "Restricted"; auth_basic_user_file /www/.htpasswd; try_files $uri /index.html; } }