【问题标题】:Multiple configurations with different locations (React App) at the same domain using Nginx使用 Nginx 在同一域中具有不同位置的多个配置(React App)
【发布时间】:2020-07-20 05:13:25
【问题描述】:

我正在尝试为 2 个不同的位置配置 Nginx。 这是我的场景。

www.example.com 
location : /var/www/example.com

example.com/panel 
location : /var/www/example.com/panel 

【问题讨论】:

    标签: django reactjs nginx nginx-location nginx-config


    【解决方案1】:

    尝试使用: http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files

    location ^~ /root {
        root /var/www/example.com;
        index index.html index.htm;
    }
    location ^~ /root/react_app(or panel) {
        root /var/www/example.com;
        index index.html index.htm;
        try_files $uri $uri/ /root/react_app/index.html;
    }
    

    【讨论】:

      猜你喜欢
      • 2017-11-12
      • 2018-03-27
      • 1970-01-01
      • 2017-11-26
      • 1970-01-01
      • 2018-05-21
      • 1970-01-01
      • 2022-11-23
      • 1970-01-01
      相关资源
      最近更新 更多