天天看點

若依 前端架構部署 apache 代替nginx的try_file

ngin是這樣的

location / {
      try_files $uri $uri/ /index.html;
      index  index.html index.htm;
    }      

nginx配置他的代理

location /prod-api/{
      proxy_set_header Host $http_host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header REMOTE-HOST $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_pass http://his.xiaochakeji.com/admin/;
    }      

apache是這樣的

<Directory "/www/wwwroot/XXX.com">
RewriteEngine on 
        RewriteCond %{REQUEST_FILENAME} !-f 
        RewriteCond %{REQUEST_FILENAME} !-d 
        RewriteRule . index.html [L] 
        SetOutputFilter DEFLATE
        Options FollowSymLinks
        AllowOverride All
        Require all granted
        DirectoryIndex index.php index.html index.htm default.php default.html default.htm
    </Directory>