Vue Shangpinhui Mall Project-day07 [53.nginx reverse proxy configuration]

insert image description here

53.nginx reverse proxy configuration

Assuming that the server has already been purchased and the project is packaged with a dist file, how can we configure it so that we can access our purchased server address and jump to our project? The answer needs to configure nginx, so that you can specify the address to jump.

nginx configuration:

  1. xshell enters the root directory /etc
  2. Enter the etc directory, there is an nginx directory under this directory, enter this directory [judging that nginx has been installed: if it has not been installed, there will only be four or five files in the directory; there will be a bunch of files in the installed directory]
  3. If you want to install nginx: yum install nginx
  4. After installing the nginx service, you will find that there is an additional nginx.conf file in the nginx directory, and configure it in this file
  5. Execute the command: vim nginx. conf to edit, mainly add the following two items
解决第一个问题:
location / {
	root /root/jch/www/shangpinhui/dist;
	index index.html;
	try_files $uri $uri /index,html;
}
解决第一个问题:
location / {
	proxy_pass http://39.98.123.211;
}
  1. The nginx server runs and executes the command: service nginx start

Links to my other related articles

1. Vue Shangpinhui mall project-day07【44. Personal center secondary routing construction+45. My order+46. Optimize login jump+47. Exclusive guard】
2. Vue Shangpinhui mall project-day07【 vue plugin-48. (understand) image lazy loading plugin]
3. vue Shangpinhui mall project-day07 [vue plugin-49. (understand) custom plugin]
4. vue Shangpinhui mall project-day07 [vue plugin- 50. (Understanding) Form Validation Plugin]
5. Vue Shangpinhui Mall Project-day07【51. Routing lazy loading】
6. Vue Shangpinhui Mall Project-day07【52. Pack files, process map files】
7. vue Shangpinhui mall project-day07【53.nginx reverse proxy configuration】
8. vue Shangpinhui mall project-day07【vue plug-in-54. (understand) generate QR code plug-in】
9. Vue Shangpinhui mall project- day07 [55. Coding test and package release project]

Guess you like

Origin blog.csdn.net/a924382407/article/details/129921856
Recommended