nginx How to point all pages to index.html in a directory. For example, when I visit /aa/ and /aa/aa/ /cc/ they all point to a file
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
This has nothing to do with nginx. nginx sets a forwarding address, and then the wsgi server listening to this address can point the route you want to the file you want to go to.
In the directory /path/to/html放个文件hello.html, is configured as follows:
/path/to/html
hello.html
server { listen 4080; location / { try_files '' /path/to/html; } location = /hello.html { root /path/to/html; } }
This has nothing to do with nginx. nginx sets a forwarding address, and then the wsgi server listening to this address can point the route you want to the file you want to go to.
In the directory
/path/to/html
放个文件hello.html
,is configured as follows: