CGerAJ commented on issue #4544:
URL: https://github.com/apache/apisix/issues/4544#issuecomment-875316440


     #  SPA application nginx config
   
   ```
   server {
     listen 80;
     server_name localhost;
   
     access_log /var/log/nginx/access.log main;
     error_log  /var/log/nginx/error.log  error;
   
     location / {
       root /usr/share/nginx/html;
       try_files $uri $uri/ @router;
       index index.html;
       expires -1;
     }
   
     location @router {
       rewrite ^.*$ /index.html break;
     }
   }
   
   ```
   When you visit a SPA single page, you are actually accessing a single page 
route, such as/goods/list, which corresponds to the routing component 
configured in a single page route. But for Nginx servers, it is thought that 
they will look for the list folder under the goods folder in the root 
directory, **A single page actually has only one page, index. HTML, so need to 
rewirte all the pages to the index page**


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to