【发布时间】:2018-01-10 15:19:15
【问题描述】:
首先我是新手,所以我还在学习它。
如果我从另一个域/站点创建超链接以响应本地主机上的应用程序,例如http://localhost:8089/foo/bar,我会遇到这个问题。它直接显示正确的页面,但如果我使用 https 协议从另一个域/站点到公共域的超链接,例如https://example.com/foo/baz,它总是重定向到主页页面(https://example.com/)
我能做些什么让它直接转到https://example.com/foo/baz。我使用此重定向设置在 nginx Web 服务器上运行 react,它适用于 php、django 等,但不会在 react 中运行。
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name example.com;
return 301 https://$server_name$request_uri;
root /home/[path to dist folder]/web/app/dist;
index index.html index.htm;
}
仅供参考,react 应用程序是使用 webpack 构建的,在此先感谢
【问题讨论】: