私はbrowserHistoryを使用して反応サイトを構築しています。現在のNginx設定はすべてのURLに対してindex.htmlを提供しますが、/adminからserver admin.htmlへのurlですが、私はそれを理解できません(サーバーの人ではありません!)。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; } }